Static
loadLoad and initialize the Silero VAD model.
This method loads the ONNX model and prepares it for inference. When options are not provided, sane defaults are used.
Promise<VAD>: An instance of the VAD class ready for streaming.
This method may take time to load the model into memory. It is recommended to call this method inside your prewarm mechanism.
export default defineAgent({
prewarm: async (proc: JobProcess) => {
proc.userData.vad = await VAD.load();
},
entry: async (ctx: JobContext) => {
const vad = ctx.proc.userData.vad! as VAD;
// the rest of your agent logic
},
});
Returns a VADStream that can be used to push audio frames and receive VAD events.