Create Speech_synthesis.md

Hey, I think this is the coolest one I found! Hope this snippet gets attraction
This commit is contained in:
Meet Zaveri
2017-12-14 22:26:08 +05:30
committed by GitHub
parent 907afe08e2
commit 1c3d3f6290

View File

@ -0,0 +1,16 @@
### 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
```
function speak (message) {
var msg = new SpeechSynthesisUtterance(message)
var voices = window.speechSynthesis.getVoices()
msg.voice = voices[0]
window.speechSynthesis.speak(msg)
}
speak('Hello, world')
```