Files
30-seconds-of-code/snippets/Speech_synthesis.md
Meet Zaveri 530e4e411a Update Speech_synthesis.md
used es6 approach acc. to contributing guidelines
2017-12-14 22:39:24 +05:30

555 B

Speech synthesis

Currently The SpeechSynthesisUtterance interface of the Web Speech API represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.)

To know more - https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance

speak = message => {
  var msg = new SpeechSynthesisUtterance(message)
  var voices = window.speechSynthesis.getVoices()
  msg.voice = voices[0]
  window.speechSynthesis.speak(msg)
 }
speak('Hello, World')