/

JavaScript Text To Speech

Simple JavaScript speech synthesis.

const speak = (message: string) => {
  var msg = new SpeechSynthesisUtterance(message);
  var voices = window.speechSynthesis.getVoices();
  msg.voice = voices[0];
  window.speechSynthesis.speak(msg);
};

Example