Chrome iOS Webkit语音识别

我试图在iPad上的Chrome上实现语音识别,没有任何运气。 只是为了削减和追赶我的webkitSpeechRecognition api的实现,Glenn Shire的优秀示例代码不能在运行iOS 5.1.1的iPad 1上的Chrome v27上运行,或者在运行iOS 7.0.4的iPad3上运行Chrome v31,至less据我所知。 它在这一行失败:

if (!('webkitSpeechRecognition' in window)) { r.onState('upgrade'); return; } 

我找不出一个解决方法,我还没有看到任何关于语音识别的任何在线发帖不在iOS版本的Chrome中工作。 其他人遇到这个?

iOS上的Chrome目前不支持语音识别function。

谷歌必须使用iOS UIWebView,这意味着没有特殊的网页解释function,Safari不支持。

你可以看看这个链接 。

如果你想识别一些简单的命令,你可以看看Pocketsphinx.js

识别语音的代码很简单:

 var id = 0; recognizer.postMessage({command: 'initialize', callbackId: id}); var keyphrase = "HELLO WORLD"; recognizer.postMessage({command: 'addKeyword', data: keyphrase, callbackId: id}); recognizer.postMessage({command: 'start', data: id}); recognizer.postMessage({command: 'process', data: array}); recognizer.postMessage({command: 'stop'}); recognizer.onmessage = function(e) { if (e.data.hasOwnProperty('hyp')) { alert(e.data.hyp); } }; 

欲了解更多详情,请参阅这里的完整示例