Skip to content

Instantly share code, notes, and snippets.

@opsb
Created November 3, 2012 17:15
Show Gist options
  • Select an option

  • Save opsb/4007987 to your computer and use it in GitHub Desktop.

Select an option

Save opsb/4007987 to your computer and use it in GitHub Desktop.
function say(phrase, language){
return function(callback){
console.log("saying " + phrase);
var audio = new Audio("http://tts.lingal.org/?tl=" + language + "&q=" + phrase);
audio.addEventListener('ended', wrapped(callback));
audio.play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment