Skip to content

VADEngine

Contract for a voice-activity-detection model.

Defined in: src/core/vad/types.ts:29

Contract for a voice-activity-detection model.

Remarks

An engine scores fixed-size mono PCM frames at its native sample rate (16 kHz for Silero) and returns a speech probability per frame. Engines are stateful across frames (recurrent models); VADEngine.reset clears that state between listening sessions.

Implement this interface to plug in an alternative model — the VADConfig.engine option accepts any implementation.

Properties

PropertyModifierTypeDescriptionDefined in
frameSamplesreadonlynumberSamples per frame the engine expects (e.g. 512 at 16 kHz ≈ 32 ms).src/core/vad/types.ts:31
sampleRatereadonlynumberSample rate the engine expects, in Hz.src/core/vad/types.ts:34

Methods

dispose()

dispose(): Promise<void>;

Defined in: src/core/vad/types.ts:57

Release model resources.

Returns

Promise<void>


initialize()

initialize(): Promise<void>;

Defined in: src/core/vad/types.ts:42

Load the model and allocate inference resources.

Returns

Promise<void>

Throws

Error if the model cannot be loaded (missing peer dependency, unreachable model URL, unsupported model format).


process()

process(frame): Promise<number>;

Defined in: src/core/vad/types.ts:51

Score one frame of audio.

Parameters

ParameterTypeDescription
frameFloat32ArrayExactly VADEngine.frameSamples mono PCM samples in the range [-1, 1] at VADEngine.sampleRate.

Returns

Promise<number>

The speech probability for the frame, in [0, 1].


reset()

reset(): void;

Defined in: src/core/vad/types.ts:54

Clear recurrent state (call between listening sessions).

Returns

void

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency