diff --git a/src/index.js b/src/index.js index d8e69f0..0f0fe8b 100644 --- a/src/index.js +++ b/src/index.js @@ -108,6 +108,8 @@ AudioPlayer.prototype.loadSounds = function (sounds) { }; AudioPlayer.prototype.playSound = function (index) { + if (!this.soundPlayers[index]) return; + this.soundPlayers[index].start(); var storedContext = this;