Spaces:
Running
Running
Download vad/mic-processor.js from zst50/testspace5: direct link, hf CLI and curl.
- Browser
- Download file 335 Bytes
-
https://huggingface.co/spaces/zst50/testspace5/resolve/main/vad/mic-processor.js
- Command line
-
hf download hf://spaces/zst50/testspace5/vad/mic-processor.js
-
curl -L -o mic-processor.js https://huggingface.co/spaces/zst50/testspace5/resolve/main/vad/mic-processor.js
335 Bytes
| 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); | |