Skip to content

Instantly share code, notes, and snippets.

@xat
Created July 6, 2014 19:47
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 xat/4dfd5bfc02d44649e616 to your computer and use it in GitHub Desktop.
Save xat/4dfd5bfc02d44649e616 to your computer and use it in GitHub Desktop.
var speak = function(text, cb) {
var u = new SpeechSynthesisUtterance();
u.text = text;
u.lang = 'de-DE';
u.rate = 1;
if (cb) u.onend = cb;
speechSynthesis.speak(u);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment