Skip to content

Commit e8617a8

Browse files
Taking delay config setting into account when playing sound source
1 parent 58da239 commit e8617a8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ var WebAudioSound = new Class({
111111
createAndStartBufferSource: function () {
112112
var _this = this;
113113
var seek = this.currentConfig.seek;
114+
var delay = this.currentConfig.delay;
115+
var when = this.manager.context.currentTime + delay;
114116
var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek;
115117
var duration = this.duration - seek;
116118
this.startTime = this.manager.context.currentTime - seek;
@@ -131,7 +133,7 @@ var WebAudioSound = new Class({
131133
// else was stopped
132134
};
133135
this.applyConfig();
134-
this.source.start(0, Math.max(0, offset), Math.max(0, duration));
136+
this.source.start(Math.max(0, when), Math.max(0, offset), Math.max(0, duration));
135137
this.resetConfig();
136138
},
137139
/**

0 commit comments

Comments
 (0)