(buffers, when, startSecs)
| 238 | // time), beginning `startSecs` into each buffer. Returns the duration of audio |
| 239 | // that will play (max over stems of buffer.duration - startSecs). |
| 240 | function _scheduleChunk(buffers, when, startSecs) { |
| 241 | let playDur = 0; |
| 242 | for (const [name, stem] of stemMap) { |
| 243 | const buf = buffers.get(name); |
| 244 | if (!buf) continue; |
| 245 | const node = ctx.createBufferSource(); |
| 246 | node.buffer = buf; |
| 247 | if (!stNode) node.playbackRate.value = _playbackRate; // tape-effect fallback |
| 248 | node.connect(stem.gain); |
| 249 | const offset = Math.max(0, Math.min(startSecs, buf.duration - 0.001)); |
| 250 | node.start(when, offset); |
| 251 | stem.activeNodes.push(node); |
| 252 | playDur = Math.max(playDur, buf.duration - offset); |
| 253 | } |
| 254 | return playDur; |
| 255 | } |
| 256 | |
| 257 | // --- lookahead scheduler --- |
| 258 |
no outgoing calls
no test coverage detected