I am trying to access the audio from chrome browser using javascript code below, but when I click the the button the recognition.onresult
event is not firing in chrome browser, however when I access the online webpage that contains live demo of speech to text, its working fine in chrome browser please help.
<script type="text/javascript">
var recognition = new SpeechRecognition();
recognition.onresult = function(event)
{
if (event.results.length > 0)
{
alert("Working");
}
}
</script>
<form>
<input type="button" value="Click to Speak"onclick="recognition.start()">
</form>