Javascript和单页应用程序:不允许语音识别

时间:2016-08-16 18:50:44

标签: javascript speech-recognition

我想编写单页应用程序html webside,只能使用html和javascript识别Google Chrome v52中的语音文字。

为此我正在使用

var recognizer = new window.speechRecognition();

总是不允许
recognizer.onerror

我试图通过

允许使用麦克风
navigator.webkitGetUserMedia({audio:true}, onSuccess, onFail);

您知道如何将导航器的容差连接到识别器吗? 或者你有一个样本在谷歌浏览器中作为单页面应用程序工作?

谢谢你, MAIK

1 个答案:

答案 0 :(得分:0)

有效 - 我的失败是使用在Google Chrome中打开本地HTML文件: file:///

当我通过 https:// 在网上部署它时,一切正常:)

相关问题