DEV Community

loading...

Discussion on: Text To Speech In 3 Lines Of JavaScript

Collapse
asaoluelijah profile image
Asaolu Elijah 🧙‍♂️ Author
var msg = new SpeechSynthesisUtterance();
msg.text = "My browser will say this sentence.";
window.speechSynthesis.speak(msg);