We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6897d65 commit 8208389Copy full SHA for 8208389
1 file changed
v3/src/sound/webaudio/WebAudioSound.js
@@ -61,9 +61,7 @@ var WebAudioSound = new Class({
61
if (!BaseSound.prototype.play.call(this, marker, config)) {
62
return null;
63
}
64
- if (this.source) {
65
- this.source.stop();
66
- }
+ this.stopAndRemoveBufferSource();
67
// TODO include config offset and marker start
68
this.createAndStartBufferSource(0, this.currentConfig.duration);
69
this.startTime = this.manager.context.currentTime;
@@ -118,8 +116,10 @@ var WebAudioSound = new Class({
118
116
* @private
119
117
*/
120
stopAndRemoveBufferSource: function () {
121
122
- this.source = null;
+ if (this.source) {
+ this.source.stop();
+ this.source = null;
+ }
123
},
124
update: function () {
125
0 commit comments