From 1126aad736f3322559007b8abc49e26f550e4b54 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Mon, 20 Jul 2009 19:14:18 -0700 Subject: [PATCH] Revert the setLanguage() call to its previous implementation as waiting to change the language right before a call to speak can put the engine in an unstable state. --- core/java/android/speech/tts/TextToSpeech.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 4e0a87c86f4f7..bb6b4b0385d84 100755 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java @@ -921,10 +921,8 @@ public class TextToSpeech { mCachedParams[Engine.TTS_PARAM_POSITION_LANGUAGE + 1] = loc.getISO3Language(); mCachedParams[Engine.TTS_PARAM_POSITION_COUNTRY + 1] = loc.getISO3Country(); mCachedParams[Engine.TTS_PARAM_POSITION_VARIANT + 1] = loc.getVariant(); - // the language is not set here, instead it is cached so it will be associated - // with all upcoming utterances. But we still need to change the language support, - // which is achieved by calling isLanguageAvailable() - result = mITts.isLanguageAvailable( + + result = mITts.setLanguage(mPackageName, mCachedParams[Engine.TTS_PARAM_POSITION_LANGUAGE + 1], mCachedParams[Engine.TTS_PARAM_POSITION_COUNTRY + 1], mCachedParams[Engine.TTS_PARAM_POSITION_VARIANT + 1] );