Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfatehi/7fdc84a17b2b3a87d3fd to your computer and use it in GitHub Desktop.
Save kfatehi/7fdc84a17b2b3a87d3fd to your computer and use it in GitHub Desktop.
Speech synthesis & recognition APIs in HTML5
<!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