Tho*_*oub 5 speech-recognition node-webkit
我正在尝试使用节点webkit语音识别API,但它给了我一个奇怪的行为.我这样初始化录音机:
var rec = new webkitSpeechRecognition();
rec.continuous = true;
rec.interimResults = true;
rec.onresult = function(e){ alert('result') };
rec.onstart = function(e){ alert('start') };
rec.onerror = function(e){ console.log(e); };
rec.onend = function(e){ alert('end') };
rec.onspeechstart = function(e){ alert('speechStart') };
rec.start();
Run Code Online (Sandbox Code Playgroud)
但是start()电话后没有任何事 唯一有效的插槽是end(),我无法弄清楚这个有用而不是其他的......我失去了什么?
我浏览这个Github问题(桌面应用的webkitSpeechRecognition?)但没有找到任何有用的信息.
webkitSpeechRecognition 需要后端语音识别系统。
Chrome可能会使用谷歌的语音识别系统。因此我们可以毫无麻烦地在 Chrome 上使用 webkitSpeechRecognition。但在其他平台上,即使它是基于webkit,它也可能无法正常工作。
我认为在支持Google或某人的引擎之前很难在node-webkit上使用语音识别功能。
CHANGELOG 0.8.0 / 10-30-2013 还说
- 在支持之前取消定义 window.webkitSpeechRecognition