文本转语音同时接收多个语音请求
我正在编写一个应用程序,可以逐个读出字符串。我的问题是,TTS 似乎在第一对夫妇中结结巴巴,正确地说出一个然后就停止了。我不明白为什么。
public void onInit(int status) {
Log.d("TTS", "2");
String text = desc;
Toast.makeText(ct, "Saying: " + text, Toast.LENGTH_LONG).show();
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
}
此 onInit 方法位于广播接收器中,因此每次收到接近警报时,它都会读取关联的字符串。我真的很感激一些帮助。
I am writing an app that reads out strings one after the other. My problem is that TTS seems to stutter through the first couple, say one properly and then stop. I can't understand why.
public void onInit(int status) {
Log.d("TTS", "2");
String text = desc;
Toast.makeText(ct, "Saying: " + text, Toast.LENGTH_LONG).show();
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
}
This onInit method is located in a Broadcast Receiver so every time a proximity alert is received it reads the associated String. I'd really appreciate some help with this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道它是否可以帮助您解决您的情况,但我面临的问题是它多次收到说话的请求,因此它不断重复新的字符串并且不完成前一个字符串。所以我做了这个技巧。希望它可以帮助你。:P
I don't know whether it can help you in your case or not,but I was facing problem like it gets requests to speak many time and hence it keeps on repeating the new strings and doesn't complete the previous one.So I did this trick.Hope it can help you for yours.:P