• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Text to speech service delay

cmasmas

Newbie
Hi everyone,

I'm making use of TTS on a application. The point is that it takes a few seconds to start up TTS service, and the voice comes with a delay. Is there a way to avoid this delay, or to make the Activity wait until TTS is ready?
Thanks for the info!
 
Hi!!

I found a way so the application waits until tts finishes to "speak".
Here is the code:

public void speak(String s)
{
mTts.speak(s, TextToSpeech.QUEUE_ADD, null);
while (mTts.isSpeaking())
{}
}

Hope it helps.
 
Back
Top Bottom