onUtteranceCompleted()丢失,如果收到的TTS太长 [英] onUtteranceCompleted() lost if TTS received is too long

查看:193
本文介绍了onUtteranceCompleted()丢失,如果收到的TTS太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Android的TTS引擎观察到无证异常:如果要说出的文本太长(大于4K字符),然后<一个href=\"http://developer.android.com/reference/android/speech/tts/TextToSpeech.OnUtteranceCompletedListener.html#onUtteranceCompleted%28java.lang.String%29\"相对=nofollow> onUtteranceCompleted()那个特定的话语永远不会到来......

I just observed an "undocumented anomaly" in Android's TTS engine: If the text to be spoken is too long (greater than 4K characters), then onUtteranceCompleted() for that particular utterance will never arrive...

有没有其他人碰到这种?

Has anyone else come across this?

这是一个已知的bug或限制?

Is this a known bug or limitation?

可以做些什么来解决此问题?

What could be done to work around this?

推荐答案

我不知道的限制,如I $讲话的对$ PFER小块(有用的,如果暂停,或者如果活动被暂停)。

I wasn't aware of the limit, as I prefer smaller chunks of speech (useful if pausing or if activity is paused).

当你打电话说,可以将新的话语添加到使用此为queueMode队列的末尾:
TextToSpeech.QUEUE_ADD

When you call speak, you can add the new utterance to the end of the queue using this for queueMode: TextToSpeech.QUEUE_ADD

测试以确保该句子没有不同的声音,但是我觉得只是在一个句子后裁切长度将工作自动解析(或字如果需要的话)。

Test to be sure the sentence doesn't sound different, but I think just automatically parsing at the next sentence (or word if needed) after a cutoff length would work.

这篇关于onUtteranceCompleted()丢失,如果收到的TTS太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆