12 lines
288 B
JavaScript
12 lines
288 B
JavaScript
class AudioProcessor extends AudioWorkletProcessor {
|
|
process(inputs) {
|
|
const input = inputs[0];
|
|
if (input.length > 0) {
|
|
const audioData = input[0];
|
|
this.port.postMessage(audioData);
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
registerProcessor('audio-processor', AudioProcessor);
|