[perf] release unused AudioBufferSourceNode + releaseAudioNode

This commit is contained in:
jeromew 2025-12-01 15:29:19 +00:00
parent 7a3e0fd3fe
commit 68b1cb87ca
5 changed files with 48 additions and 26 deletions

View file

@ -508,13 +508,14 @@ class SuperSawOscillatorProcessor extends AudioWorkletProcessor {
];
}
process(_input, outputs, params) {
if (currentTime <= params.begin[0]) {
return true;
}
if (currentTime >= params.end[0]) {
// this.port.postMessage({ type: 'onended' });
// should terminate
return false;
}
if (currentTime <= params.begin[0]) {
// keep alive
return true;
}
const output = outputs[0];
const voices = params.voices[0]; // k-rate
for (let i = 0; i < output[0].length; i++) {