I have a function that checks to see if a browser supports speech recognition or not, and it alerts whether it supports or not, and it works well, except that it does not alert anything when the user is using Google Chrome, but DOES NOT have the microphone plugged in.
I would like it to check to see if the user has their microphone plugged in or not. Is that possible?
function recognize() {
window.speechRecognition = window.speechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.webkitSpeechRecognition;
if (window.speechRecognition == undefined) {
alert("Speech Recognition Only Supported in Google Chrome");
} //end of if (window.speechRecognition == undefined)
else {
alert("Speech Recognition is Supported.");
} //end of else if (window.speechRecognition != undefined)
} //end of function recognize()
if(confirm('Is your microphone plugged in?')) {
//they said yes :-)
} else {
//they said no :-(
}