J
J
J. Snow2016-09-07 12:49:11
Android
J. Snow, 2016-09-07 12:49:11

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");

That is, only Locale.US works for me .
And everything works in Pocket .
Where do I spit?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
itdroid, 2016-09-07
@itdroid

Hello, look at the Google Text-to-speech Engine settings, like this:
Settings->Accessibility->Text-to-speech output->Google Text-to-speech Engine
See if you have voice data installed on your device for the locale you expose in code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question