Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome iOS webkit speech-recognition

I'm trying to implement speech recognition on Chrome on the iPad without any luck. Just to cut to the chase and remove any dependencies on my implementation of the webkitSpeechRecognition api, Glenn Shire's excellent sample code does not run on Chrome v27 on an iPad 1 running iOS 5.1.1 or Chrome v31 on an iPad3 running iOS 7.0.4, at least as far as I can tell. It fails at this line:

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

I can't figure out a workaround, and I've not seen any online postings that say anything about speech recognition not working in the iOS version of Chrome. Anyone else run into this?

like image 283
Gnarlito Avatar asked Dec 17 '13 16:12

Gnarlito


2 Answers

Chrome on iOS doesn't support Speech Recognition at the moment.

Google have to use iOS UIWebView that mean there is no special web interpretation feature that are not supported on Safari.

You may have a look to this link.

like image 132
Sébastien Lehmann Avatar answered Oct 20 '22 03:10

Sébastien Lehmann


In case you want to recognize few simple commands you can look on Pocketsphinx.js

The code to recognize speech is simple:

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);
     }
};

For more details see also the full example here

like image 33
Nikolay Shmyrev Avatar answered Oct 20 '22 03:10

Nikolay Shmyrev