Skip to main content
https://travis-ci.org/wiseman/py-webrtcvad.svg?branch=master

py-webrtcvad

This is a python interface to the WebRTC Voice Activity Detector (VAD). It is compatible with Python 2 and Python 3.

A VAD classifies a piece of audio data as being voiced or unvoiced. It can be useful for telephony and speech recognition.

The VAD that Google developed for the WebRTC project is reportedly one of the best available, being fast, modern and free.

How to use it

  1. Install the webrtcvad module:

    pip install webrtcvad
  2. Create a Vad object:

    import webrtcvad
    vad = webrtcvad.Vad()
  3. Optionally, set its aggressiveness mode, which is an integer between 0 and 3. 0 is the least aggressive about filtering out non-speech, 3 is the most aggressive. (You can also set the mode when you create the VAD, e.g. vad = webrtcvad.Vad(3)):

    vad.set_mode(1)
  4. Give it a short segment (“frame”) of audio. The WebRTC VAD only accepts 16-bit mono PCM audio, sampled at 8000, 16000, or 32000 Hz. A frame must be either 10, 20, or 30 ms in duration:

    # Run the VAD on 10 ms of silence. The result should be False.
    sample_rate = 16000
    frame_duration = 10  # ms
    frame = b'\x00\x00' * (sample_rate * frame_duration / 1000)
    print 'Contains speech: %s' % (vad.is_voiced(frame, sample_rate)

See example.py for a more detailed example that will process a .wav file, find the voiced segments, and write each one as a separate .wav.

Metadata

Release files for webrtcvad 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webrtcvad 1.0.7
File Size Uploaded Provenance Actions
webrtcvad-1.0.7.tar.gz 64.3 kB Without provenance Details for webrtcvad-1.0.7.tar.gz

Release files / webrtcvad-1.0.7.tar.gz

Download URL webrtcvad-1.0.7.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
efcf407afba6869c949de59ba45127b743bd12e03471ccf16d1780387e3f0d3f
BLAKE2b-256 checksum
How to use checksums
2182882938ee41cc9440405197bb8d4c1285502141b837ca7b567f8effd7d003
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for webrtcvad 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page