I am new to web development and I am trying to develop a simple voice web application using the Web Speech API. I used this simple tutorial to learn the basics of a voice program.
Here is the code that I wrote as a simple start.
<!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"> </script> <script> var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.onresult = function(event) { alert("onresult even handler"); } function startButton(event) { recognition.start(); } </script> </head> <body> <div id = "text"> <button id="start_button" onclick="startButton(event)"> start </button> </div> </body> </html>
But when I open the html page in google chrome browser and click on start, this is what I see:

And when I click on the crossed camera icon, I see the following dropdown menu:

Even when I select "Ask if the file wants - wants to access your camera and microphone", and reload the page, it will repeat the same.
When I did more research on this, I found out that Google Chrome only allows a secure site (for example, https: //) to access your camera and microphone. If it is not https, then chrome blocks it without asking the user. But I canβt understand why my local file is blocked from using a microphone. Can anyone help me on this. Thanks in advance.
source share