Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TTS Languages

I am playing with the Android TTS engine. I am trying to set it to speak in Spanish from Mexico, rather than from Spain.

I have tried several combination's of language code / country code but I have not been able to get anything by Spanish from Spain. Here is my code currently

loc = new Locale("es", "MEX");
myTts.setLanguage(loc);
say("Hello");

I have also tried ("es","US"), ("es","LA"), ("spa","US"), ("spa","MEX") with every combination that I can think of it is showing me this in the log:

TtsEngine::setLanguage found matching language(spa) but not matching country(MEX).

loaded es-ES successfully

I can exit my app and open up the TTS Service Extended. If I set the language to either Spanish[es] or Spanish-Latin America. Either way when I hit 'listen to preview' I get "Hola" which is expected. But from my application I get "Heyyo" instead of "Hola". Can anyone see what I am doing incorrectly to set my language?

like image 693
Tim Avatar asked Aug 26 '10 16:08

Tim


People also ask

Can TTS read other languages?

Spanish text-to-speech software, also known as TTS, can read out content written in English and other languages in your language.

How do I get different text to speech voices on Android?

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.

What is language detection on Google TTS options?

Adjust language switching If you use more than one language in Android, tap Language detection to set how Text-to-speech switches between them. Select Aggressive if it's not switching fast enough, or Conservative if it's switching too fast.


1 Answers

I have used the following code and it is working fine in Spanish.

Locale locSpanish = new Locale("spa", "MEX");
tts.setLanguage(locSpanish);
tts.speak(text, TextToSpeech.QUEUE_ADD, null);
like image 55
Joseph Selvaraj Avatar answered Oct 30 '22 19:10

Joseph Selvaraj