diff --git a/src/blocks/scratch3_sound.js b/src/blocks/scratch3_sound.js index 87fbb0aaf..4bdfd2da8 100644 --- a/src/blocks/scratch3_sound.js +++ b/src/blocks/scratch3_sound.js @@ -39,12 +39,12 @@ Scratch3SoundBlocks.prototype.getPrimitives = function () { Scratch3SoundBlocks.prototype.playSound = function (args, util) { var index = this._getSoundIndex(args.SOUND_MENU, util); - util.target.audioPlayer.playSound(index); + util.target.playSound(index); }; Scratch3SoundBlocks.prototype.playSoundAndWait = function (args, util) { var index = this._getSoundIndex(args.SOUND_MENU, util); - return util.target.audioPlayer.playSound(index); + return util.target.playSound(index); }; Scratch3SoundBlocks.prototype._getSoundIndex = function (soundName, util) { diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index d7a94fd06..3eab61429 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -465,6 +465,9 @@ RenderedTarget.prototype.updateAllDrawableProperties = function () { this.runtime.spriteInfoReport(this); }; +RenderedTarget.prototype.playSound = function (index) { + return this.audioPlayer.playSound(this.sprite.sounds[index].md5); +}; /** * Return the human-readable name for this rendered target, e.g., the sprite's name. * @override