开发者

Android: Question about TTS use

开发者 https://www.devze.com 2023-04-07 16:44 出处:网络
I\'m using a TTS engin开发者_如何转开发e, and i want to disable the buttons until the tts message has finished, so the user can\'t select an option on the screen until the tts message has been listene

I'm using a TTS engin开发者_如何转开发e, and i want to disable the buttons until the tts message has finished, so the user can't select an option on the screen until the tts message has been listened completely.

I've been trying using

while (tts.isSpeaking())
{
    button.setclickable(false);
}
button.setclickable(true);

but it's not working.

I guess that is because tts.isSpeaking doesn't work as i expected.


check the Utterance concept with this TTS using this you can implement your task check here

http://developer.android.com/resources/articles/tts.html

http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#setOnUtteranceCompletedListener%28android.speech.tts.TextToSpeech.OnUtteranceCompletedListener%29

0

精彩评论

暂无评论...
验证码 换一张
取 消