Unable to detect completion of TTS (callback) android.

前端 未结 3 1157
情书的邮戳
情书的邮戳 2021-01-04 18:53

I am developing android application in which I am using text to speech conversion.What I need when I open my application run text to speech conversion. After completion of t

3条回答
  •  醉酒成梦
    2021-01-04 19:42

    If you are using API level 15 or later you can set a progress listener on your TextToSpeech reference using

    setOnUtteranceProgressListener(UtteranceProgressListener listener)
    

    You will get callbacks reporting the progress of the TTS, including a callback when it is finished. See http://developer.android.com/reference/android/speech/tts/TextToSpeech.html and http://developer.android.com/reference/android/speech/tts/UtteranceProgressListener.html

    However, I notice that you're already using the deprecated OnUtteranceCompletedListener. Are you getting the callbacks on onUtteranceCompleted()? That should also work.

提交回复
热议问题