问题描述
我的工作文本到语音应用程序,但我遇到一个问题,我不知道present字TTS说话。有没有办法找到这个?
I'm working on Text to speech application but I encounter a problem that I couldn't know the present word that TTS is speaking. Is there any way to find this.?
例如:如果TTS是讲这个字符串:已经的问题,可能已经有你的答案当它到达'已经',我怎么能突出
For Example: If TTS is speaking this string: Questions that may already have your answer and when it reaches 'already', how can I highlight 'already.'
推荐答案
我建议TextToSpeech.speak()中的使用顺序:
I propose that use sequence of TextToSpeech.speak():
- 在开始说第一个字。
- 选中第一个字。
- 在检测第一个字是合成已完成。
- start speaking first word.
- highlight first word.
- detect that synthesizing of first word has finished.
- 在开始说第二个字。
- 在强调第二个字。
- 在检测第二个字是合成已完成。
- 等等...
现在就只剩如何检测一个单词的合成已经完成?
使用 TextToSpeech.setOnUtteranceCompletedListener()
检测话语已经完成。
Now it only remains How to detect that synthesizing of a word has finished?
Use TextToSpeech.setOnUtteranceCompletedListener()
to detect utterance has completed.
您可以看到这些网页了解更多详情:
如何知道什么时候TTS完成?
介绍到文本到语音的安卓
You can see these pages for more details:
How to know when TTS is finished?
An introduction to Text-To-Speech in Android
这篇关于高亮显示当前字TTS引擎正在说话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!