diff --git a/v3/src/sound/webaudio/WebAudioSound.js b/v3/src/sound/webaudio/WebAudioSound.js index 378cafa74..945e31cef 100644 --- a/v3/src/sound/webaudio/WebAudioSound.js +++ b/v3/src/sound/webaudio/WebAudioSound.js @@ -84,10 +84,6 @@ var WebAudioSound = new Class({ var seek = this.currentConfig.seek; var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek; var duration = this.duration - seek; - this.rateUpdates.push({ - time: 0, - rate: 1 - }); this.createAndStartBufferSource(offset, duration); this.startTime = this.manager.context.currentTime - seek; this.pausedTime = 0; @@ -134,7 +130,6 @@ var WebAudioSound = new Class({ this.source = this.manager.context.createBufferSource(); this.source.buffer = this.audioBuffer; this.source.connect(this.muteNode); - this.rateUpdates.length = 0; this.applyConfig(); this.source.onended = function (ev) { if (ev.target === this.source) { @@ -156,6 +151,14 @@ var WebAudioSound = new Class({ this.source = null; } }, + applyConfig: function () { + this.rateUpdates.length = 0; + this.rateUpdates.push({ + time: 0, + rate: 1 + }); + BaseSound.prototype.applyConfig.call(this); + }, /** * Update method called on every game step. *