Skip to main content

Voice Activity Detector (VAD) by Silero

Project description

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


  • Stellar accuracy

    Silero VAD has excellent results on speech detection tasks.

  • Fast

    One audio chunk (30+ ms) takes less than 1ms to be processed on a single CPU thread. Using batching or GPU can also improve performance considerably. Under certain conditions ONNX may even run up to 4-5x faster.

  • Lightweight

    JIT model is around two megabytes in size.

  • General

    Silero VAD was trained on huge corpora that include over 6000 languages and it performs well on audios from different domains with various background noise and quality levels.

  • Flexible sampling rate

    Silero VAD supports 8000 Hz and 16000 Hz sampling rates.

  • Highly Portable

    Silero VAD reaps benefits from the rich ecosystems built around PyTorch and ONNX running everywhere where these runtimes are available.

  • No Strings Attached

    Published under permissive license (MIT) Silero VAD has zero strings attached - no telemetry, no keys, no registration, no built-in expiration, no keys or vendor lock.


Typical Use Cases


  • Voice activity detection for IOT / edge / mobile use cases
  • Data cleaning and preparation, voice detection in general
  • Telephony and call-center automation, voice bots
  • Voice interfaces

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 = {hello@silero.ai}
}

Examples and VAD-based Community Apps


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

silero_vad-6.2.1.tar.gz (28.9 MB view details)

Uploaded Source

Built Distribution

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

silero_vad-6.2.1-py3-none-any.whl (9.1 MB view details)

Uploaded Python 3

File details

Details for the file silero_vad-6.2.1.tar.gz.

File metadata

  • Download URL: silero_vad-6.2.1.tar.gz
  • Upload date:
  • Size: 28.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for silero_vad-6.2.1.tar.gz
Algorithm Hash digest
SHA256 b23062b0e39fad17b1266fc23c1e7b4290219dbe82ce08510889e32f681f4b3b
MD5 0514b3a97dc7bf44da903025ff793724
BLAKE2b-256 32d3e31f526482782764aa4f70e20fd4545cf2e4a81a60b6fb0f089f6d107991

See more details on using hashes here.

File details

Details for the file silero_vad-6.2.1-py3-none-any.whl.

File metadata

  • Download URL: silero_vad-6.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for silero_vad-6.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09de93c4d874bb19c53e62a47dd38be5f163cedad2b5599583231f2a84ef79cb
MD5 85f1691523a528034f1a9eb3b766767d
BLAKE2b-256 0b2b48566f29a8b53d856ceb1994f209122749b3fda0a733a07e82047257de7a

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