Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node webkit speech recognition API

I'm trying to use the node webkit speech recognition API but it gives me a strange behavior. I initialize the recorder like that :

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

But nothing occurs after start() call. The only slot which works is end() and I can't figure out this one works and not the other ones... What am I loosing ?

I browse this Github issue (webkitSpeechRecognition for desktop apps?) but don't find any useful information.

like image 435
Thomas Ayoub Avatar asked Oct 01 '22 04:10

Thomas Ayoub


1 Answers

webkitSpeechRecognition needs a back-end speech recognition system.

Chrome may use Google's speech recognition system. So we can use webkitSpeechRecognition on Chrome without any hassle. But on others even though it is based on webkit, It may not work properly.

I think it's difficult to use speech recognition feature on node-webkit before supporting Google's or someone's engine.

Also CHANGELOG 0.8.0 / 10-30-2013 says

- undefine window.webkitSpeechRecognition before it's supported

like image 183
emeth Avatar answered Oct 05 '22 12:10

emeth