diff --git a/src/sound/html5/HTML5AudioSound.js b/src/sound/html5/HTML5AudioSound.js index c00d43b69..8a6dc2e1d 100644 --- a/src/sound/html5/HTML5AudioSound.js +++ b/src/sound/html5/HTML5AudioSound.js @@ -320,6 +320,21 @@ Object.defineProperty(HTML5AudioSound.prototype, 'volume', { this.emit('volume', this, value); } }); +/** + * Playback rate. + * + * @name Phaser.Sound.HTML5AudioSound#rate + * @property {number} rate + */ +Object.defineProperty(HTML5AudioSound.prototype, 'rate', { + set: function (value) { + this.currentConfig.rate = value; + if (this.checkTouchLocked('property', 'rate', value)) { + return; + } + Object.getOwnPropertyDescriptor(BaseSound.prototype, 'rate').set.call(this, value); + } +}); /** * Current position of playing sound. *