ricky0123 / vad

Voice activity detector (VAD) for the browser with a simple API
https://www.vad.ricky0123.com
Other
901 stars 143 forks source link

[QUESTION] Opinions on how to use offline #152

Closed Melona-BS closed 1 week ago

Melona-BS commented 1 week ago

I was wondering if I could make that vad package work offline as an example I use on the web. If you've ever used a related source, or know anything, please let me know actively!

+) Current progress is attempting to import the ONNX model from the local path.

Melona-BS commented 1 week ago

I haven't tested it, but I managed to get the package from the local file path. The file was downloaded from unpkg and referred to as a script.

script : ort.js dist / bundle.min.js / vad.worklet.bundle.min.js model : silero_vad.onnx

const myvad = await vad.MicVAD.new({
                workletURL: // including file path "vad.worklet.bundle.min.js',
                modelURL: // including file path 'silero_vad.onnx',
                ...
                ortConfig: (ort) => {
                    ort.env.wasm.wasmPaths = // including dir path 'ort/dist/',
                },
            });
            myvad.start();
});

I hope this experiment will be helpful.