Skip to content

Guide · Open source

How to use silero-vad: install and detect speech in Python

Updated · written with AI from the project's own documentation and checked against our catalogue data

Silero VAD is a pre-trained voice activity detector: it listens to audio and marks the parts that contain human speech. This guide is for developers who want to add speech detection to a Python project, trim silence from recordings or clean audio datasets. By the end you will know how to install the package, run the basic example and understand the options the README describes.

Silero VADsnakers4/silero-vad · ★ 10.6k · MIT

Quick start

  1. 1Check your environment. Confirm Python 3.8 or newer, torch 1.12.0 or newer and a CPU with AVX-family instructions.
  2. 2Install the package. Run pip install silero-vad[audio], or pip install silero-vad if you load audio yourself.
  3. 3Load the model. Call load_silero_vad() to get the pre-trained model.
  4. 4Read your audio. Use read_audio on a file path, or pass your own 1-D float32 tensor. Use 8000 Hz or 16000 Hz audio.
  5. 5Get speech timestamps. Call get_speech_timestamps with return_seconds=True to get start and end times of speech.

What Silero VAD is and what it does not do

Silero VAD finds speech regions in audio. Developers use it to cut silence out of recordings, decide when someone has started or stopped talking, or clean datasets before further processing.

It is a library with no GUI described in the source, and it does not convert speech to text. The README points to separate speech-to-text models in another repository.

Check the requirements before you install

The README lists Python 3.8 or newer, torch 1.12.0 or newer, 1G+ RAM and a modern x86-64 CPU with AVX, AVX2, AVX-512 or AMX instruction sets.

The model itself needs only torch. FFmpeg (4-9) is needed only if you use the torchcodec audio backend.

  • Python 3.8+
  • torch>=1.12.0
  • 1G+ RAM
  • Modern x86-64 CPU with AVX, AVX2, AVX-512 or AMX
  • FFmpeg 4-9, only for the torchcodec backend

Install silero-vad with pip

If you want the bundled audio loading helpers, install the audio extra. If you already load audio yourself, install the minimal package instead.

The README also notes that the [audio] extra pulls in torchcodec on Python 3.9+ and that torchaudio 2.9 and later need it to decode audio.

pip install silero-vad[audio] pip install silero-vad

Detect speech in an audio file

Load the model, read a file and call get_speech_timestamps. Setting return_seconds=True returns timestamps in seconds; the default is samples.

The README's example uses read_audio from the bundled helpers. If you load audio yourself, pass a 1-D float32 torch.Tensor to get_speech_timestamps instead.

  • Use 8000 Hz or 16000 Hz audio, the two rates the README lists as supported.
from silero_vad import load_silero_vad, read_audio, get_speech_timestamps model = load_silero_vad() wav = read_audio('path_to_audio_file') speech_timestamps = get_speech_timestamps( wav, model, return_seconds=True, # Return speech timestamps in seconds (default is samples) )

Use torch.hub instead of pip

The README also shows loading the model through torch.hub. This example sets torch to one thread and unpacks the utility functions from the returned tuple.

import torch torch.set_num_threads(1) model, utils = torch.hub.load(repo_or_dir='snakers4/silero-vad', model='silero_vad') (get_speech_timestamps, _, read_audio, _, _) = utils wav = read_audio('path_to_audio_file') speech_timestamps = get_speech_timestamps( wav, model, return_seconds=True, )

Choose an ONNX or GPU setup if needed

The README lists extras for ONNX on CPU and ONNX on GPU. It also says ONNX can be used from other languages through ONNX Runtime, and that the project includes examples in C++, Rust, Go and Java.

If you run only onnx-runtime, you will have to implement the audio input and output yourself and adapt the wrappers or post-processing to your use case.

  • silero-vad[onnx-cpu] installs onnxruntime and numpy
  • silero-vad[onnx-gpu] installs onnxruntime-gpu and numpy

What people use it for

  • Cutting silence out of call recordings before storage or transcription
  • Deciding when a user has started or stopped speaking in a voice bot
  • Removing non-speech sections from audio datasets
  • Adding voice activity detection to IoT, edge or mobile projects that need a small model

Frequently asked questions

Is silero-vad free to use?

The source lists the license as MIT. The README says it has no telemetry, no keys, no registration and no built-in expiration. Check the LICENSE file in the repository for the full terms.

What does silero-vad require?

Python 3.8 or newer, torch 1.12.0 or newer, 1G+ RAM and a modern x86-64 CPU with AVX, AVX2, AVX-512 or AMX. FFmpeg 4-9 is needed only for the torchcodec audio backend.

Which sample rates does silero-vad support?

The README lists 8000 Hz and 16000 Hz as the supported sampling rates. Projects needing other rates should resample their audio first.

Can silero-vad transcribe speech to text?

No. Silero VAD only detects speech regions. The README points to separate speech-to-text models in the silero-models repository.

Why does get_speech_timestamps return samples instead of seconds?

By default it returns sample indexes. Pass return_seconds=True to get timestamps in seconds, as the README example does.

How does silero-vad compare with WebRTC VAD, pyannote.audio or Vosk?

The source lists these as comparable projects but does not benchmark them against Silero VAD, so this guide makes no claim about which is more accurate. Silero VAD's README reports its own quality and performance metrics on its wiki.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Silero VAD suits Python developers who need a small, free, pre-trained speech detector for apps, telephony pipelines or dataset cleaning. Pick something else if you need speech-to-text, a ready-made desktop app, or support for sample rates other than 8000 Hz and 16000 Hz.

Install options & downloads