Skip to content

Instantly share code, notes, and snippets.

@baseonmars
Created November 3, 2012 17:24
Show Gist options
  • Save baseonmars/4008018 to your computer and use it in GitHub Desktop.
Save baseonmars/4008018 to your computer and use it in GitHub Desktop.
function say(phrase, language) {
var audio = ...
return audio.play()
}
function Audio(...) {
}
Audio.prototype.play = function () {
var def = new $.Deferred()
var player = new Player();
player.onFinsish(function () { def.resolve() });
player.play();
return def
}
say("hello", "en").then(doTheNextThis).fail(errorhandler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment