1var msg = new SpeechSynthesisUtterance();
2msg.text = "Hello World";
3window.speechSynthesis.speak(msg);
4
1// Narrate some text:
2var msg = new SpeechSynthesisUtterance('Hello world!');
3window.speechSynthesis.speak(msg);
4
5// Cancel the narration:
6window.speechSynthesis.cancel();