Skip to content

Commit dbc4b8b

Browse files
Renamed createLoopBufferSource to createAndStartLoopBufferSource and added some logic for starting loop source
1 parent d13bdfd commit dbc4b8b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ var WebAudioSound = new Class({
145145
/**
146146
* @private
147147
*/
148-
createLoopBufferSource: function () {
148+
createAndStartLoopBufferSource: function () {
149149
this.loopSource = this.createBufferSource();
150+
var offset = this.currentMarker ? this.currentMarker.start : 0;
151+
var duration = this.duration;
152+
this.loopSource.start(Math.max(0, this.startTime + duration), Math.max(0, offset), Math.max(0, duration));
150153
},
151154
/**
152155
* Used internally to do what the name says.

0 commit comments

Comments
 (0)