What is the best way to know if the user has allowed microphone access after creating an instance of webkitSpeechRecognition
?
The first idea that came to my mind was using the webkitSpeechRecognition:onstart
method to update a local status reference:
var permission = false;
var recognition = new webkitSpeechRecognition();
recognition.continuous = true;
recognition.interimResults = true;
recognition.onstart = function() { permission = true; }
But this seems redundant, since a global readonly value may be already set by the browser.
Any thoughts?