Web Speech API中的网络错误

时间:2013-01-28 22:04:13

标签: javascript google-chrome html5-audio speech-to-text

我正在尝试使用Web Speech API演示:https://www.google.com/intl/en/chrome/demos/speech.html。您至少需要25.0版Chrome才能运行它。

我正在尝试连续使用Web Speech API进行长时间转录(10-15分钟)。但是,我注意到大约1-2分钟后出现“网络”错误(如Web Speech API Spec:https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-onerror中所述)。

有没有人知道为什么这个“网络”错误在1-2分钟之后发生得非常一致,并且是否有任何方法可以配置Web Speech API以进行更长时间的连续转录?

谢谢!

1 个答案:

答案 0 :(得分:0)

网络语音API通常有60秒的识别时间。

您需要调用speechrecognition.onend()方法,然后调用speechrecognition.start()。所以在停止后继续表彰。