silero-vad README

The project's README from github.com/snakers4/silero-vad. As one markdown file: README.md.

Mailing list : test Mailing list : test License: CC BY-NC 4.0 downloads

Open In Colab Test Package Pypi version Python version

header


Silero VAD


Silero VAD - pre-trained enterprise-grade Voice Activity Detector (also see our STT models).


Real Time Example

https://user-images.githubusercontent.com/36505480/144874384-95f80f6d-a4f1-42cc-9be7-004c891dd481.mp4

Please note, that video loads only if you are logged in your GitHub account.


Fast start


Dependencies

System requirements to run python examples on x86-64 systems:

  • python 3.8+;
  • 1G+ RAM;
  • A modern CPU with AVX, AVX2, AVX-512 or AMX instruction sets.

Dependencies:

  • torch>=1.12.0;
  • torchaudio>=0.12.0 (for I/O only);
  • onnxruntime>=1.16.1 (for ONNX model usage).

Silero VAD uses torchaudio library for audio I/O (torchaudio.info, torchaudio.load, and torchaudio.save), so a proper audio backend is required:

  • Option №1 - FFmpeg backend. conda install -c conda-forge 'ffmpeg<7';
  • Option №2 - sox_io backend. apt-get install sox, TorchAudio is tested on libsox 14.4.2;
  • Option №3 - soundfile backend. pip install soundfile.

If you are planning to run the VAD using solely the onnx-runtime, it will run on any other system architectures where onnx-runtume is supported. In this case please note that:

  • You will have to implement the I/O;
  • You will have to adapt the existing wrappers / examples / post-processing for your use-case.

Using pip: pip install silero-vad

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)
)

Using torch.hub:

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,  # Return speech timestamps in seconds (default is samples)
)

Key Features



Typical Use Cases



Links



Get In Touch


Try our models, create an issue, start a discussion, join our telegram chat, email us, read our news.

Please see our wiki for relevant information and email us directly.

Citations

@misc{Silero VAD,
  author = {Silero Team},
  title = {Silero VAD: pre-trained enterprise-grade Voice Activity Detector (VAD), Number Detector and Language Classifier},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/snakers4/silero-vad}},
  commit = {insert_some_commit_here},
  email = {[email protected]}
}

Examples and VAD-based Community Apps


silero-vad (snakers4/silero-vad)

voice-recognition
Searching Database…

What is this?Silero VAD is a pre-trained, enterprise-grade Voice Activity Detector: a compact model that tells you which parts of an audio stream contain speech.
Is it a ready-to-run app, or a model I wire into my own code?It is a model with Python wrappers, not an end-user app — there is no UI. You call it from your own code, feeding it audio chunks and getting speech/no-speech decisions back.
How do I get it into my project?Install the Python package with 'pip install silero-vad', or load the model via torch.hub, then run it on your audio.
What does it need installed alongside it?Python 3.8+ with torch>=1.12.0 and torchaudio>=0.12.0 for audio I/O (a backend like FFmpeg is required); add onnxruntime>=1.16.1 only if you use the ONNX model.
Will it run on any machine, or does it need specific hardware?On x86-64 it needs a modern CPU with AVX, AVX2, AVX-512 or AMX instruction sets plus 1 GB+ of RAM — very old CPUs without AVX will not work.
What do people typically use it for?Typical uses: voice activity detection for IoT/edge/mobile, data cleaning and general voice detection, telephony and call-center automation, voice bots and voice interfaces.
Can I use it outside Python, like from C++, Rust, or in the browser?Yes — besides Python it ships as ONNX, with community examples in C++, Rust, Go, Java and C#, plus browser use via ONNX Runtime Web. It runs wherever PyTorch or ONNX runtimes do.
Any licensing catches if I ship it in a product?None — it is MIT licensed with zero strings attached: no telemetry, no keys, no registration, no built-in expiration, no vendor lock.
How big is the model itself?Tiny — the JIT model is around two megabytes, which is one reason it fits edge and mobile deployments.
Which sample rates does it accept?Two: 8000 Hz and 16000 Hz, so audio has to be resampled to one of these rates before detection.
Can it transcribe what is being said?No, it only detects speech activity, not words. For transcription you would pair it with a separate STT model — the same team publishes those too.
Creator
snakers4
Size
120.5 MB
Stars
10.5K
Age
5y
Commits · 90 Days