Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make HTML5 speech recognition not ask permission every time

I have created a script that requires my microphone. It uses the HTML5 speech recognition API. Chrome asks permission every time I want to perform a speech recognition test.

Javascript (partial) code that I am using:

         var recognition = new webkitSpeechRecognition();
            recognition.continuous = true;
            recognition.interimResults = true;
            recognition.onresult = function(event) {
                console.log(event.results[0][0].transcript);
                if(event.results[0][0].transcript === 'print')
                {
                    console.log('');
                }
            };

            recognition.start();

I have tried to add it into the list of exceptions in either Chrome and Flash player, but it still asks for permission.

Printscreen:

Print screen example

That message pops up everytime I click the button. Is there any way to disable Chrome for asking permission?

like image 209
Mihael Keehl Avatar asked Oct 22 '25 19:10

Mihael Keehl


1 Answers

As jschorr mentioned in the comments above, only using HTTPS will prevent the browser from asking for permissions every time recognition is started

As clearly stated here

like image 195
Ron Harlev Avatar answered Oct 25 '25 08:10

Ron Harlev