2

I am working on an application in which i would like to use TTS to read text. I want to support Indian Languages offline so i have installed eSpeak Text To Speech engine in my android device and have set it as default. After understanding Speech Synthesis Markup Language (SSML) i realized that i can give phonemes as an input to make the Speech Engine pronounce words correctly. So i created a sample application in which i am using TextToSpeech class of Android.

String text = "[[ D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt ]]";// "This is some phonetic text input"
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);

I read in the documentation of espeak that to make the engine understand phonemes, simply put phonetic expression in double square brackets and it would accept it as phoneme and render it accordingly. But this doesn't work in Android. Is the syntax correct?

Thanks

Udit Shah
  • 241
  • 2
  • 14

1 Answers1

0

I directly used following code with Punjabi language unicode text in my app and it works.

m_objTTS = new TextToSpeech(this, this, "com.googlecode.eyesfree.espeak");

m_strTexttoSpeak =  "ਸਕਰੀਨ ਤੇ ਟੈਪ ਕਰੋ|"; // its punjabi translation for "Tap on Screen"

m_objTTS.speak(m_strTexttoSpeak,TextToSpeech.QUEUE_FLUSH, null, null);

You should have espeak TTS app installed on mobile device and set it as default TTS engine. Default system language set to language of your choice ( Punjabi is set in my case )

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134