34 Commits

Author SHA1 Message Date
David 'Digit' Turner
01f2f960e7 Improved native TTS interface header.
The purpose of this patch is to add a C-based ABI that can be exposed by the NDK
for developers wanting to write a TTS Engine. This replaces the C++ ABI that is
currently under frameworks/base/include/tts/TtsEngine.h but is *binary* compatible
with it.

As a consequence, the svox pico plugin under external/svox/pico/tts/, which
links against tts/TtsEngine.h can be loaded by the TTS service properly.

Another patch would modify the pico tts to use <android/tts.h>, then we will
be able to get rid of <tts/TtsEngine.h> in the source tree.

Change-Id: I16844cef9b5b006cc32655a29e4f9f193c8c1a91
2010-06-11 18:02:51 -07:00
Dan Bornstein
782e9fd749 For issue #2651381, allow library prelinking.
Change-Id: I1cb467a158e21fc02cac6af585ac8d27c2bf42de
2010-05-05 18:23:05 -07:00
Jean-Michel Trivi
900e0d0954 Update TTS plugin interface to receive engine configuration data
coming from the plugin helper code (handling config and preferences).

Change-Id: Ibc1d229463f11f8977552d74d1fd2aa6a6cab88e
2010-03-18 11:52:41 -07:00
Kenny Root
1ead4f0f70 Expand buffer in SynthProxy to hold int
32-bit signed integers are 11 bytes and a byte at the end for \0

Change-Id: I6a9cf69ecc64614c610cbade1c3398506d6f62f5
2010-03-04 11:06:59 -08:00
Jean-Michel Trivi
e3c1890a4c Fix bug 2452941 Add a flag to maintain the intended direct playback
of TTS data independently from the associated AudioTrack state.
 Only start the track when it's been stopped but is supposed to be
 playing.
2010-02-24 18:52:39 -08:00
Jean-Michel Trivi
0320f8bdfb Apply EQ on the output of the speech synthesis only when using the Pico
TTS engine.
2010-01-11 14:16:28 -08:00
Jean-Michel Trivi
ddc63ad04b Remove useless start of AudioTrack for TTS and improper volume setting.
The AudioTrack that plays the synthesized audio data should only be
started when the first synthesis request is sent, not after the
initialization of the engine.
The track volume should be initialized to it nominal level. Volumes
above 1 do not provide amplification, so setting the volume to 2 is
not necessary.
2010-01-08 15:03:50 -08:00
Joe Onorato
f5d95cbc1a less log spew 2010-01-08 15:46:24 -05:00
Jean-Michel Trivi
3218471bcd Modify the gain after filtering to prevent TTS clipping in en-US. 2009-09-01 13:46:43 -07:00
Jean-Michel Trivi
09f8db7ad3 Add a synchronous stop method to TTS synth engine so that upon its destruction,
if it was synthesing to a file, the latter can be deleted without
still being written to.
Clear the hashmap of SpeechItem to be stopped (mKillList) when the speech
queue is empty.
2009-08-31 11:39:20 -07:00
Jean-Michel Trivi
0deb41abc6 am 0950c5de: Merge change 21226 into donut
Merge commit '0950c5de864d1ad83ed96efc5c2d1569b4d36188' into eclair

* commit '0950c5de864d1ad83ed96efc5c2d1569b4d36188':
  Fix bug 2046705 where the output of the speech synthesizer is too low.
2009-08-18 08:44:51 -07:00
Jean-Michel Trivi
4fb7d882b2 Fix bug 2046705 where the output of the speech synthesizer is too low.
The language files for the SVOX Pico engine result in the output of
the synthesizer to be too soft, and barely audible on a phone speaker.
The change implements a low shelf filter on the output of the synthesis
and a drastic amplification. This works as intended because the
synthesized data contains too much energy in the lower frequencies that
is wasted on a phone speaker. Once filtered out, they leave room for
amplication to address the volume issue.
2009-08-14 10:05:19 -07:00
Eric Laurent
a553c25b33 Fix issue 1795088 Improve audio routing code
Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
2009-07-23 06:03:39 -07:00
Jean-Michel Trivi
d702c357fc Increase the volume of the AudioTrack instance used for the speech synthesis. 2009-07-21 18:10:04 -07:00
Jean-Michel Trivi
cee3bd4d68 Reset the speech synth singleton to null when the service is destroyed
so it can be recreated when the service is initialized.
In the interface with the native synthesizer library, close the lib
in the finalizer, delete the global ref to the SynthProxy java object.
2009-07-21 14:22:25 -07:00
Jean-Michel Trivi
5e11a6ad00 Prevent the setLanguage() method in TextToSpeech to change the language
for all current TextToSpeech instances by only caching the language
value so it is used with each subsequent utterance for this instance.
Synchronize calls to the engine around a global mutex since the engine
isn't thread-safe, except for the stop() call which is meant to interrupt
the synthesis loop.
2009-07-20 16:07:57 -07:00
Charles Chen
342c329203 Fixing the random audio mangling problem (TTS becomes incomprehensibly fast) 2009-07-18 00:25:21 -07:00
Jean-Michel Trivi
8b86da899a Remove obsolete playBuffer() method from the text-to-speech SynthProxy class. 2009-07-17 18:22:15 -07:00
Jean-Michel Trivi
19e53f7ae5 Delete global ref to the weak reference to the SynthProxy in the
native_finalize function, that was created in native_setup to prevent
leaking refs.
2009-07-16 20:13:12 -07:00
Charles Chen
4a3368ffe8 Making sure that the audio buffers for speech are cleared
so that there are no leftovers which could cause mangled output.
2009-07-14 18:21:27 -07:00
Jean-Michel Trivi
9440bce855 Propagate optional audio stream type to the creation of the audio resources
to enable the playback of TTS content on various stream types.
2009-07-13 11:34:30 -07:00
Charles Chen
2a8a2d76f1 Removing the ttsSynthDoneCallback logging. 2009-07-07 16:24:02 -07:00
Charles Chen
b02ced7e45 Cleaning up logs.
Initializing SpeechItem.mText to "" instead of null to
prevent a null from accidentally being used when it is a
non-text utterance.
2009-07-07 14:57:16 -07:00
Charles Chen
35b86c273a Adding tts result codes. 2009-07-06 10:51:48 -07:00
Jean-Michel Trivi
f07d824ba4 In TTS synthesis to file, remove hard coded values for the writing of the WAV header.
Corrected TTS Service manifest to allow writing to external storage.
Corrected memory management when the end of synthesis is signaled.
2009-06-30 09:50:12 -07:00
Jean-Michel Trivi
bee1c7e6a4 Expose in SynthProxy the query for the TTS supported and current language. 2009-06-29 16:07:17 -07:00
Jean-Michel Trivi
287148b80b Add in TTS engine interface the methods to query the availability for a language,
to set the synthesis audio format, to query the current language, country and
variant setting.
2009-06-29 09:52:17 -07:00
Jean-Michel Trivi
d6d03e05be Use the same interface in the TTS engine interface for setLanguage and loadLanguage.
Adding function to check the support level for a language in TTS engine interface.
2009-06-26 09:46:28 -07:00
Jean-Michel Trivi
6c24f24b3e In the native layer for the TTS service, delete the data allocated for the callback after the signal for the end of the synthesis has been received. 2009-06-25 17:10:26 -07:00
Jean-Michel Trivi
6a0e293c84 Fix bug in TTS service where the language setting was using the default language
when the setting wasn't enforced, and vice-versa.
Cleaning the log of the native TTS layer to use LOGV for verbose messages,
rather than LOGI.
2009-06-24 11:32:06 -07:00
Jean-Michel Trivi
2ea5349583 Adding support for pitch changes of the synthesized text in Text-To-Speech. 2009-06-23 15:26:57 -07:00
Jean-Michel Trivi
679d728f09 Using Locale to specify language and country for a TTS language to load,
rather than a String.
Cleanup in doc for TextToSpeech, and addition of queue mode constants.
2009-06-17 10:16:17 -07:00
Jean-Michel Trivi
35a8e80bf8 Updating TTS engine interface for setting the language based on language, country and variant codes
coming from a java.util.Locale instance.
2009-06-16 13:25:15 -07:00
Charles Chen
f85aa5a4d4 Restructuring the TTS files so that it works as a Service 2009-06-10 13:31:09 -07:00