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.
3 files changed