Reputation: 20916
TextToSpeech tts = new TextToSpeech(context, this);
tts.speak(text, TextToSpeech.QUEUE_ADD, null);
how can i know when speech is finished with speaking, becouse when stop talking i need to execute some extra code. But i have problem becouse i don't knowh how to check if speech is finished with talking.
Is there any option to check this?
Upvotes: 1
Views: 1972
Reputation: 86948
Yes, there are two listeners:
I haven't used the UtteranceProgressListener, but the OnUtteranceCompletedListener is very particular. Here are two tips:
onInit()
callback, never before.params
to speak()
with a valid KEY_PARAM_UTTERANCE_ID
, otherwise this listener is never called.Upvotes: 7
Reputation: 442
public boolean isDoneSpeaking() {
if(!mTts.isSpeaking())
{
return true;
}
else
{
return false;
}
}
Upvotes: -1
Reputation: 9005
As for as i know there is no listener for this but we have method called isSpeaking()
to check whether TTS engine is busy speaking or not. So that you can take the help of this method to check it is speaking or not
Upvotes: 1