// Captures the raw input samples (channel 0) and posts them to the main thread. class CaptureProcessor extends AudioWorkletProcessor { process(inputs) { const ch = inputs[0] && inputs[0][0]; if (ch) this.port.postMessage(ch.slice()); return true; } } registerProcessor("capture", CaptureProcessor);