Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

label: string = 'silero.VAD'

Accessors

Methods

  • Load 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.

    Parameters

    • opts: Partial<VADOptions> = {}

    Returns Promise<VAD>

    Promise<VAD>: An instance of the VAD class ready for streaming.

    Remarks

    This method may take time to load the model into memory. It is recommended to call this method inside your prewarm mechanism.

    Example

    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
    },
    });