Octoroom.Agent.VAD.Silero (octoroom_agents v0.1.0)

Copy Markdown View Source

Silero VAD (v5 ONNX) speech-probability analyzer for 16 kHz mono PCM16 audio.

Each analyzer holds its own recurrent state, so create one per audio stream. The ONNX model is loaded once per path and shared between streams.

Audio is consumed in 512-sample (32 ms) frames; leftovers are buffered until the next call. Like the reference implementation, each frame is prefixed with the last 64 samples of the previous frame.

Summary

Functions

Loads (or reuses) the ONNX model and returns a fresh analyzer.

Appends PCM16 audio and returns the speech probability of every complete frame it produced, in order.

Clears recurrent state and buffered audio.

Types

t()

@type t() :: %Octoroom.Agent.VAD.Silero{
  buffer: term(),
  context: term(),
  model: term(),
  state: term()
}

Functions

default_model_path()

frame_ms()

new(opts \\ [])

@spec new(keyword()) :: {:ok, t()} | {:error, term()}

Loads (or reuses) the ONNX model and returns a fresh analyzer.

process(silero, pcm)

@spec process(t(), binary()) :: {[float()], t()}

Appends PCM16 audio and returns the speech probability of every complete frame it produced, in order.

reset(silero)

@spec reset(t()) :: t()

Clears recurrent state and buffered audio.

sample_rate()