I want to make an application that can support different languages.
There is no problem with the "default" languages:
tts.setLanguage(Locale.ENGLISH);
And also some other:
Locale l = new Locale("ru","RU");
tts.setLanguage(l);
But a lot of others don't work, eg.:
Locale l = new Locale("hu","HU");
tts.setLanguage(l);
I have also tried "hu"
, "hu-HU"
, "hu-rHU"
, "HU"
... but nothing...
Also, it doesn't work with Turkish, Greek, Dutch, Czech...
Select Text-to-Speech voice settings. Under "Speech Engines," next to "Acapela TTS Engine," select Settings. Select the voice(s) you want to purchase. Return to Text-to-Speech voice settings and under "Preferred Voices," choose the voice you want to use.
android.speech.tts.TextToSpeech. Synthesizes speech from text for immediate playback or to create a sound file. A TextToSpeech instance can only be used to synthesize text once it has completed its initialization. Implement the TextToSpeech. OnInitListener to be notified of the completion of the initialization.
Not all are supported, use: Locale.getAvailableLocales() to get available possible locales and test them against isLanguageAvailable, or since api21 you can use getAvailableLanguages() to directly get available languages for current TTS engine. You can install alternative TTS engine, ie. SVOX is quite good.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With