In Android Text To speech using Google engine, you can't change the language without re-calling the 'onInit()' method. How can I recall this method, without restarting the application?
Asked
Active
Viewed 676 times
0
1 Answers
0
You don't need to restart the 'application', you could just shutdown()
the current TTS object and initialise a new one. That would then call onInit()
.
However, you don't need to do this to change the language, you can do this at any time by calling mTTS.setLanguage(Locale.GERMAN)
If you kept a reference to the original language before the switch, you can then just switch back once the utterance is completed.

brandall
- 6,094
- 4
- 49
- 103