if ('speechSynthesis' in window) {
// new speech recognition object
var recognition = new window.SpeechRecognition() || window.webkitSpeechRecognition;
// Recognition start event handler
recognition.onstart = () => {
console.log('Voice recognition started. Try speaking into the microphone.');
}
} else {
console.log('Speech recognition not supported 😢');
// code to handle error
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.