i started using this browser function (chrome). I wrote JS based on this, but the problem is that it only recognizes speech once and ends. it is not going to constantly, I need to press the button again and again to start speech recognition. tell me where i have to fine tune. I set "recognition .continuous = true" still doesn't help?
var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; recognition.onstart = function() { console.log("Recognition started"); }; recognition.onresult = function(event){ console.log(event.results); }; recognition.onerror = function(e) { console.log("Error"); }; recognition.onend = function() { console.log("Speech recognition ended"); }; function start_speech() { recognition.lang = 'en-IN';
I call "start_speech" with a button! thats it
source share