Speech recognition 节点webkit语音识别API
我试图使用NodeWebKit语音识别API,但它给了我一个奇怪的行为。我对记录器进行如下初始化:Speech recognition 节点webkit语音识别API,speech-recognition,node-webkit,Speech Recognition,Node Webkit,我试图使用NodeWebKit语音识别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 = fun
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();
但是在调用start()
之后什么也不会发生。唯一有效的插槽是end()
,我想不出这个插槽有效,而其他插槽无效。。。我失去了什么
我浏览了一下,但没有找到任何有用的信息。webkitSpeechRecognition需要一个后端语音识别系统 Chrome可能会使用谷歌的语音识别系统。因此,我们可以在Chrome上使用webkitSpeechRecognition,而无需任何麻烦。但是,在其他情况下,即使它基于webkit,也可能无法正常工作 我认为,在支持谷歌或其他人的引擎之前,很难在NodeWebKit上使用语音识别功能 同样,变更日志0.8.0/10-30-2013中也指出 -取消定义window.webkitSpeechRecognition,然后再支持它