Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class SignalProcessor extends AudioWorkletProcessor {
constructor() {
super();
this.buffers = [];
this.port.onmessage = (e) => {
console.log(e, this.buffers);
this.port.postMessage(this.buffers);
// this.buffers.length = 0;
};
}
process(inputs, outputs, parameters) {
this.buffers.push(inputs);
return true;
}
}
registerProcessor('signal-processor', SignalProcessor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment