Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have developed one simple application in android. It converts the text data to speech but it only working for English language not for other like Marathi, Hindi. How to solve this problem?
Posted

1. Make sure you have installed TTS engine: https://play.google.com/store/apps/details?id=com.google.android.tts&hl=en[^]
2. Set the language you want to use: http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#setLanguage(java.util.Locale)[^] For example:
VB
mTts.isLanguageAvailable(Locale.UK))
mTts.isLanguageAvailable(Locale.FRANCE))
mTts.isLanguageAvailable(new Locale("spa", "ESP")))


mTts.setLanguage(Locale.US);

C#
String myText1 = "Did you sleep well?";
String myText2 = "I hope so, because it's time to wake up.";
mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);
mTts.speak(myText2, TextToSpeech.QUEUE_ADD, null);


For more information, you can read An introduction to Text-To-Speech in Android[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900