diff --git a/src/index.js b/src/index.js index babdb5e..4ad39b4 100644 --- a/src/index.js +++ b/src/index.js @@ -113,16 +113,12 @@ AudioEngine.prototype.loadSounds = function (sounds) { }; AudioEngine.prototype.playSound = function (index) { - // if the soundplayer exists and its buffer has loaded - if (this.soundPlayers[index].buffer && this.soundPlayers[index].buffer.loaded) { - // play the sound - this.soundPlayers[index].start(); + this.soundPlayers[index].start(); - var storedContext = this; - return new Promise(function (resolve) { - storedContext.soundPlayers[index].onEnded(resolve); - }); - } + var storedContext = this; + return new Promise(function (resolve) { + storedContext.soundPlayers[index].onEnded(resolve); + }); }; AudioEngine.prototype.playNoteForBeats = function (note, beats) { @@ -187,15 +183,12 @@ AudioEngine.prototype.stopAllSounds = function () { // for (var i = 0; i 0) { - for (var i=0; i