DEV Community

davidka7
davidka7

Posted on

Let your window speak your text

Here are the basics you will need for text to speech.
It should work on all browsers but if not you can put if or else statement checking if 'speechSynthesis' in window exists or is supported.
var msg = new SpeechSynthesisUtterance();
msg.text = "Hello, my name is Peter";
window.speechSynthesis.speak(msg);

Top comments (0)