W3C Link: https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
Last active
August 29, 2015 14:02
-
-
Save kfatehi/7fdc84a17b2b3a87d3fd to your computer and use it in GitHub Desktop.
Speech synthesis & recognition APIs in HTML5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<script type="text/javascript"> | |
var speak = function() { | |
var u = new SpeechSynthesisUtterance(); | |
u.text = 'Hello World'; | |
u.lang = 'en-US'; | |
u.rate = 1.2; | |
u.onend = function(event) { console.log(event.elapsedTime) } | |
speechSynthesis.speak(u); | |
} | |
speak(); | |
</script> | |
<a href="#" onclick="speak()">Speak!</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment