js narrate text

JavaScript
// Narrate some text:
var msg = new SpeechSynthesisUtterance('Hello world!');
window.speechSynthesis.speak(msg);

// Cancel the narration:
window.speechSynthesis.cancel();
Source

Also in JavaScript: