diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2009-07-20 14:05:33 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2009-07-20 16:07:57 -0700 |
commit | 5e11a6ad00b062d604b30578e0fb412ae4586989 (patch) | |
tree | 4762a0c6d6ebb7dec291f02a5438ec292564d746 /packages/TtsService/src/android/tts/TtsService.java | |
parent | 5f6133a100d4477dfcea919e81ff301f9352cd32 (diff) | |
download | frameworks_base-5e11a6ad00b062d604b30578e0fb412ae4586989.zip frameworks_base-5e11a6ad00b062d604b30578e0fb412ae4586989.tar.gz frameworks_base-5e11a6ad00b062d604b30578e0fb412ae4586989.tar.bz2 |
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.
Diffstat (limited to 'packages/TtsService/src/android/tts/TtsService.java')
-rwxr-xr-x | packages/TtsService/src/android/tts/TtsService.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java index 28801f8..9a4c97d 100755 --- a/packages/TtsService/src/android/tts/TtsService.java +++ b/packages/TtsService/src/android/tts/TtsService.java @@ -546,7 +546,7 @@ public class TtsService extends Service implements OnCompletionListener { if (!synthAvailable) { Thread.sleep(100); Thread synth = (new Thread(new SynthThread())); - synth.setPriority(Thread.MIN_PRIORITY); + //synth.setPriority(Thread.MIN_PRIORITY); synth.start(); return; } @@ -608,7 +608,7 @@ public class TtsService extends Service implements OnCompletionListener { } } Thread synth = (new Thread(new SynthThread())); - synth.setPriority(Thread.MIN_PRIORITY); + //synth.setPriority(Thread.MIN_PRIORITY); synth.start(); } @@ -623,7 +623,7 @@ public class TtsService extends Service implements OnCompletionListener { if (!synthAvailable) { Thread.sleep(100); Thread synth = (new Thread(new SynthThread())); - synth.setPriority(Thread.MIN_PRIORITY); + //synth.setPriority(Thread.MIN_PRIORITY); synth.start(); return; } @@ -677,7 +677,7 @@ public class TtsService extends Service implements OnCompletionListener { } } Thread synth = (new Thread(new SynthThread())); - synth.setPriority(Thread.MIN_PRIORITY); + //synth.setPriority(Thread.MIN_PRIORITY); synth.start(); } |