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
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.