开发者

Android: Question about TTS use

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜