Silero Voice Activity Detection Plugin
A fast and accurate Voice Activity Detection (VAD) plugin for GetStream that uses the Silero VAD model.
Installation
pip install getstream-plugins-silero
Usage
from getstream.plugins.silero import SileroVAD
from getstream.video.rtc.track_util import PcmData
# Initialize with default settings
vad = SileroVAD()
# Or customize parameters
vad = SileroVAD(
sample_rate=16000,
frame_size=512,
silence_threshold=0.3,
speech_pad_ms=300,
min_speech_ms=250,
max_speech_ms=60000,
)
# Register event handlers
@vad.on("audio")
async def on_audio(pcm_data, user):
print(f"Detected speech: {pcm_data.duration:.2f} seconds")
# Process the detected speech with an STT engine
# await stt.process_audio(pcm_data)
# Process incoming audio
incoming_audio = PcmData(samples=audio_bytes, sample_rate=16000, format="s16")
await vad.process_audio(incoming_audio)
# Reset state if needed
await vad.reset()
Configuration Options
sample_rate: Audio sample rate in Hz (default: 16000)frame_size: Size of audio frames to process (default: 512)silence_threshold: Threshold for detecting silence (0.0 to 1.0) (default: 0.5)speech_pad_ms: Number of milliseconds to pad before/after speech (default: 300)min_speech_ms: Minimum milliseconds of speech to emit (default: 250)max_speech_ms: Maximum milliseconds of speech before forced flush (default: 30000)
Metadata
Release files for getstream-plugins-silero 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| getstream_plugins_silero-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for getstream_plugins_silero-0.1.0-py3-none-any.whl |
Release files / getstream_plugins_silero-0.1.0-py3-none-any.whl
| Download URL | getstream_plugins_silero-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1918485fa91d4e86f4fac24732926124b61791d2ddf69bc0a661a2be50e97538
|
|
BLAKE2b-256 checksum How to use checksums |
3d1736bd2716c1a5329f3d13fd1c29c77a5b108fe42eb19ede5673afcc9e3444
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for getstream-plugins-silero 0.1.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.