Skip to main content

Silero VAD model for fasr

Project description

fasr-vad-silero

Chinese documentation

Streaming Silero VAD for fasr. The model is loaded through torch.hub and wrapped as a fasr streaming VADModel that emits AudioChunk objects with segment_start, segment_mid, and segment_end states.

Install

pip install fasr-vad-silero

Registered Model

Registry name Class Best for
stream_silero SileroStreamVAD Lightweight streaming VAD

Streaming Usage

from fasr.config import registry

vad = registry.vad_models.get("stream_silero")(
    threshold=0.5,
    silence_duration_ms=400,
)

for input_chunk in audio_chunks:
    for speech_chunk in vad.push_chunk(input_chunk):
        print(speech_chunk.vad_state, speech_chunk.start_ms, speech_chunk.end_ms)

Quick choices:

Goal Use Result
Reduce noise triggers threshold=0.65 Requires higher speech probability
Keep quiet speech threshold=0.35 More sensitive, with more false-positive risk
End speech sooner silence_duration_ms=200 Lower endpoint latency
Avoid chopping pauses silence_duration_ms=700 More tolerant of short pauses

Confection Config

[vad_model]
@vad_models = "stream_silero"
threshold = 0.5
silence_duration_ms = 400
prefix_padding_ms = 0
sample_rate = 16000
chunk_size_ms = 32

Parameters

Parameter Type / range Default Higher value Lower value Change when
threshold float, 0.0 to 1.0 0.5 More conservative; fewer noise starts More sensitive; more weak speech Noise triggers starts, or quiet speech is missed
silence_duration_ms int >= 0 400 Longer pauses before ending speech Faster endpoint Speech is chopped, or endpoint is late
prefix_padding_ms int >= 0 0 Keeps more leading context and reduces prefix clipping Keeps segments tighter but raises the risk of clipping the first syllable The beginning of an utterance is cut off, or too much pre-roll noise is included
sample_rate int 16000 Keep at 16 kHz for Silero Keep at 16 kHz for Silero Usually do not change
chunk_size_ms int 32 Larger input chunks, fewer calls Smaller chunks, lower latency Realtime scheduling needs tuning

Tuning Guide

Symptom Try first
Background noise starts speech Raise threshold to 0.6 or 0.7
Quiet speech is missed Lower threshold to 0.35 or 0.4
Speech ends too late Lower silence_duration_ms to 200 or 300
Speech is split during pauses Raise silence_duration_ms to 600 or 800
The first syllable is clipped Raise prefix_padding_ms to 64 or 128

Runtime Turn Detection

stream_silero supports realtime turn-detection updates through apply_turn_detection(...). This hook is intended for websocket-style server sessions where VAD behavior may be adjusted after the session has started.

Runtime-adjustable fields:

  • silence_duration_ms
  • threshold
  • prefix_padding_ms

prefix_padding_ms is implemented in the wrapper state machine: when speech is first detected, the emitted segment start is moved earlier by the configured amount while clamping to the beginning of the buffered audio.

Dependencies

  • fasr
  • numpy >= 1.24
  • torch >= 2.0.0
  • Python 3.10-3.12

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fasr_vad_silero-0.5.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasr_vad_silero-0.5.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file fasr_vad_silero-0.5.3.tar.gz.

File metadata

  • Download URL: fasr_vad_silero-0.5.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr_vad_silero-0.5.3.tar.gz
Algorithm Hash digest
SHA256 f5aec47937f906ac62a5baf9e76721cbbb78bb2f3101ec9ab461569bccbec865
MD5 7e0d99d0a025f171019ead06b0952520
BLAKE2b-256 d2d050a51a2b650a08bf52013a1d87de620754bef7692a3388baddf599be32a5

See more details on using hashes here.

File details

Details for the file fasr_vad_silero-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: fasr_vad_silero-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr_vad_silero-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a62e86149aced5efeb10005bbe87448f7226870054660ba6562b4b4adc37a40e
MD5 76df75f3fd500ef2a880aaf3f08bd757
BLAKE2b-256 4b2f56b69ae02eb3f1fd2165911a6e4c7361e1d4f6bf57d5f41f205d71337ce2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page