NexusCS

JavaScript speech synthesis

JavaScript
Web Speech API: SpeechSynthesis and SpeechSynthesisUtterance reference.

SpeechSynthesisUtterance

function speak(message) {
  var msg = new SpeechSynthesisUtterance(message);
  var voices = window.speechSynthesis.getVoices();
  msg.voice = voices[0];
  window.speechSynthesis.speak(msg);
}
speak("Hello, world");

See: SpeechSynthesisUtterance (developer.mozilla.org)