Js Speech Cheat Sheet

From WikiOD

Here is the cheatsheat of Js Speech and basic guide on how to use Js Speech

SpeechSynthesisUtterance[edit | edit source]

{: .-one-column}

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)

Credit:rstacruz