Spaces:
Running
Running
File size: 335 Bytes
3b5fb7e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | class MicProcessor extends AudioWorkletProcessor {
process(inputs) {
const input = inputs[0];
if (input.length > 0) {
const channel = input[0];
const samples = channel.slice();
this.port.postMessage(samples, [samples.buffer]);
}
return true;
}
}
registerProcessor("mic-processor", MicProcessor);
|