0

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
PeakGen
  • 21,894
  • 86
  • 261
  • 463

1 Answers1

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