VadSilero

processing extra: vad-silero

Use the Silero VAD model to perform voice activity detection on audio content. Find the model here: https://github.com/snakers4/silero-vad

Node type:

VadSilero

Input:

AudioPayload

Output:

AudioPayload

Extra:

vad-silero

$ pip install "juturna-nodes[vad-silero]"

How it works

The node keeps the last keep audio messages, and runs the model on their concatenation every time a new message arrives. The output payload carries the speech found in that audio, and the output meta describes it:

Meta key

Description

silence

true when no speech was detected

speech_timestamps

The detected speech segments

duration_after_vad

Duration of the speech audio left after the detection

original_audio

The audio the detection ran on, before the cut

sequence_number

Version of the last buffered message

TranscriberWhisper relies on silence and speech_timestamps, so the two nodes are usually linked together.

Arguments

The detection arguments are passed to the Silero get_speech_timestamps function.

Argument

Type

Default

Description

device

str

cpu

Where to run the model (cpu or cuda)

rate

int

16000

Sampling rate of the source audio, in Hz

threshold

float

0.75

Speech probability threshold

min_speech_duration_ms

int

0

Discard speech chunks shorter than this

max_speech_duration_s

float or str

"inf"

Split speech chunks longer than this

min_silence_duration_ms

int

2000

Silence to wait after speech ends before cutting

speech_pad_ms

int

400

Padding added to each side of a speech chunk

keep

int

1

Number of audio messages the detection runs on

License

  • Code and weights: silero-vad, MIT (its LICENSE file and the PyPI classifier); the model ships inside the silero-vad package.

  • Runtime: PyTorch, BSD-3-Clause (its LICENSE file).

Configuration

Default node arguments, as defined in the node config.toml file. Any of them can be overridden in the node configuration of a pipeline.

[arguments]
device = "cpu"
rate = 16000
threshold = 0.75
min_speech_duration_ms = 0
max_speech_duration_s = "inf"
min_silence_duration_ms = 2000
speech_pad_ms = 400
keep = 1

[meta]

Pipeline usage

{
  "name": "vad_silero",
  "type": "VadSilero",
  "configuration": {}
}

Reference

class VadSilero(
device: str,
rate: int,
threshold: float,
min_speech_duration_ms: int,
max_speech_duration_s: float | str,
min_silence_duration_ms: int,
speech_pad_ms: int,
keep: int,
**kwargs,
)

Node implementation class