Update Speech_synthesis.md

This commit is contained in:
Meet Zaveri
2017-12-14 22:43:10 +05:30
committed by GitHub
parent 530e4e411a
commit 8af4dfaa73

View File

@ -7,8 +7,8 @@ To know more - https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisU
```
speak = message => {
var msg = new SpeechSynthesisUtterance(message)
var voices = window.speechSynthesis.getVoices()
const msg = new SpeechSynthesisUtterance(message)
const voices = window.speechSynthesis.getVoices()
msg.voice = voices[0]
window.speechSynthesis.speak(msg)
}