user772561
user772561

Reputation: 1

onUtteranceCompleted does not fires in Android

onUtteranceCompleted does not fires after speak() completed.

This is the code

HashMap dummyTTSParams = new HashMap(); dummyTTSParams.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "theUtId"); mTts.speak("Hello how are you",TextToSpeech.QUEUE_FLUSH, dummyTTSParams);

what is the reason for not calling onUtteranceCompleted(), I mentioned the utterance id "theUtId".

Replay me

Upvotes: 0

Views: 508

Answers (2)

Depa
Depa

Reputation: 11

And it's very important to call the setOnUtteranceCompletedListener AFTER the TTS initialization. A good place is the onInit method (the Activity has to implement an OnInitListener interface) when the following condition has been satisfied:

status == TextToSpeech.SUCCESS

Upvotes: 1

Sunil Kumar Sahoo
Sunil Kumar Sahoo

Reputation: 53657

check whether you have added the setOnUtteranceCompletedListener listener.

Please have a look here

Thanks Deepak

Upvotes: 0

Related Questions