Did you know javascript have native text-to-sppech?
Try it in your console.
const speak = (msg, lg = 'en') => {
const sp = new SpeechSynthesisUtterance(msg);
[sp.voice] = speechSynthesis.getVoices();
sp.lang = lg;
speechSynthesis.speak(sp);
};
speak('Hello, my name is Alison Silva, and I\'m a software developer. Did you know javascript have native text-to-sppech?');
You include can change the language as you see in the code above.
Top comments (0)