-
foundry: the audition loop belongs in the audio thread, not on a 4 Hz poll · 66318b6e
The loops panel looped an <audio> element from a `timeupdate` listener: `if (currentTime >= end) currentTime = start`. `timeupdate` fires at most about every 250 ms, and analyze_chops offers slices of 0.25-2.0 s (engine/loops.py:322) — the poll interval was the same length as the thing being looped. Playback overshot `end` by up to a whole region and only snapped back on the next tick, and every snap was a seek on a streamed element, which rebuffers and gaps the seam. Audible result: a stutter at 4 Hz, reported as "play/pause toggle every 200ms". It was. No poll rate fixes a 250 ms region, so the fix is a deletion. An AudioBufferSourceNode with loop/loopStart/loopEnd loops in the audio thread: sample-accurate, gapless, no polling and no seeking, correct for a chop and for a 30 s loop alike. The AudioBuffer is already decoded because drawWave needs it, so audition is now instant after the waveform appears, and the context is resumed on the click that needs it. tests/test_audition_loop.py is a mechanical guard on the served page: three of its four assertions fail against the previous version, verified.
PLN (Algolia) authored66318b6e
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| index.html | Loading commit data... |