Skip to main content

Energy VAD

Simple energy-based voice activity detector (VAD) with no external dependencies.

Energy threshold is calibrated from initial audio, or can be set manually.

Installation

pip install energy-vad

Example

import wave
from energy_vad import EnergyVad

vad = EnergyVad()

with wave.open("test.wav", "rb") as wav_file:
    assert wav_file.getframerate() == 16000
    assert wav_file.getsampwidth() == 2
    assert wav_file.getnchannels() == 1
    
    chunk = wav_file.readframes(vad.samples_per_chunk)
    while len(chunk) == vad.bytes_per_chunk:
        result = vad.process_chunk(chunk)
        if result is None:
            # calibrating
            pass
        elif result:
            # speech
            print("!", end="")
        else:
            # silence
            print(".", end="")

        chunk = wav_file.readframes(vad.samples_per_chunk)
        
print("")
print("Energy threshold:", vad.threshold)

# Clear calibrated threshold
vad.reset_calibration()

Metadata

Release files for energy-vad 1.0.0

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

Source distribution (sdist)

Source distribution for energy-vad 1.0.0
File Size Uploaded Provenance Actions
energy_vad-1.0.0.tar.gz 4.1 kB Without provenance Details for energy_vad-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for energy-vad 1.0.0
File Interpreter ABI Platform Actions
energy_vad-1.0.0-py3-none-any.whl Python 3 none any Details for energy_vad-1.0.0-py3-none-any.whl

Total release size: 8.0 kB

Release files / energy_vad-1.0.0.tar.gz

Download URL energy_vad-1.0.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
27e390e7280577de4a3c6541e8aeaff0ae2b3cb834f58c8e3b10b25a95e0f755
BLAKE2b-256 checksum
How to use checksums
041fadd776bfa7ece604aa0b4ae113b134cfbb2ad17705ac49832defdd3d14ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release files / energy_vad-1.0.0-py3-none-any.whl

Download URL energy_vad-1.0.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f17faabfdd47b51f1abbe246180313fa124af9372b09b897072b4d4270e3b9b
BLAKE2b-256 checksum
How to use checksums
3c7cf5df8c919694b5df73e9a800b3bafdf301132c9189c468c18a1fef80a0e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Security for energy-vad 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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