Answer the question
In order to leave comments, you need to log in
Android TTS: Why doesn't setLanguage() work?
Hi all!
I'm trying to use TTS in the application, but I can't get it to speak in a language other than en_US . For example, when I try to set the language to en_GB , the engine stops reading the text (no sound; the speak() method works instantly).
I'm developing on a standard emulator, on which the necessary language packs from Google Text-to-speech Engine are installed (I checked it in Pocket - TTS works as it should).
The code is simple, nothing special:
OnInitListener listener = new OnInitListener() {
public void onInit(int status) {
tts.setLanguage(Locale.UK); // возвращает LANG_COUNTRY_AVAILABLE
tts.speak("Hello", TextToSpeech.QUEUE_FLUSH, null);
}
};
TextToSpeech tts = new TextToSpeech(activity, listener, "com.google.android.tts");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question