Skip to content

Commit 7f0930e

Browse files
stopping source buffer if sound is already playing on play for WebAudioSound
1 parent ead02ec commit 7f0930e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ var WebAudioSound = new Class({
5151
if (!BaseSound.prototype.play.call(this, marker, config)) {
5252
return null;
5353
}
54+
if (this.source) {
55+
this.source.stop();
56+
}
5457
this.source = this.manager.context.createBufferSource();
5558
this.source.buffer = this.audioBuffer;
5659
this.source.connect(this.muteNode);

0 commit comments

Comments
 (0)