Javascript 单页应用:不允许语音识别
Javascript and single-page application: speech recognition not-allowed
我想编写一个单页应用程序 html webside 仅使用 html 和 javascript 识别 Google Chrome v52 中的语音到文本.
为此,我正在使用
var recognizer = new window.speechRecognition();
但在
时总是 not-allowed
recognizer.onerror
我试图通过
允许使用麦克风
navigator.webkitGetUserMedia({audio:true}, onSuccess, onFail);
你知道如何将navigator的allowance连接到recognizer吗?
或者您是否有在 Google Chrome 中用作单页应用程序的示例?
谢谢,
迈克
它起作用了 - 我的失败是在 Google Chrome 中使用打开本地 HTML 文件:file:///
当我通过 https:// 将其部署到网络时,一切正常:)
我想编写一个单页应用程序 html webside 仅使用 html 和 javascript 识别 Google Chrome v52 中的语音到文本.
为此,我正在使用
var recognizer = new window.speechRecognition();
但在
时总是 not-allowedrecognizer.onerror
我试图通过
允许使用麦克风navigator.webkitGetUserMedia({audio:true}, onSuccess, onFail);
你知道如何将navigator的allowance连接到recognizer吗? 或者您是否有在 Google Chrome 中用作单页应用程序的示例?
谢谢, 迈克
它起作用了 - 我的失败是在 Google Chrome 中使用打开本地 HTML 文件:file:///
当我通过 https:// 将其部署到网络时,一切正常:)