Fix release behavior; add multi-line example

This commit is contained in:
Aria 2026-01-08 16:39:10 -06:00
parent d4b3a3b972
commit e6e96c8603
3 changed files with 143 additions and 8 deletions

View file

@ -1528,16 +1528,11 @@ class GenericProcessor extends AudioWorkletProcessor {
}
process(inputs, outputs) {
const input = inputs[0]?.[0];
if (currentTime > this.end) {
if (currentTime >= this.end) {
return false;
}
else if (this.genSample === undefined || currentTime < this.start) {
} else if (this.genSample === undefined || currentTime < this.start) {
// pending
return true;
} else if (input === undefined) {
// if no input and started, return false and close worklet
// else just keep waiting (true)
return !this.started;
}
this.started = true;
if (!this.gateEnded && currentTime > this.gateEnd) {