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 vision-agents-plugins-silero 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vision_agents_plugins_silero-0.1.11.tar.gz | 16.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vision_agents_plugins_silero-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 kB
Release files / vision_agents_plugins_silero-0.1.11.tar.gz
| Download URL | vision_agents_plugins_silero-0.1.11.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a911e61c1bbc5e385f545a9447f8ce09a73c3be38150d9c39f99df55d2fd5451
|
|
BLAKE2b-256 checksum How to use checksums |
aa25c54b97d92c12a69cc00f55681f40e8553f1a3857c4a72aaa1456c6e58bb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.19
|
Release files / vision_agents_plugins_silero-0.1.11-py3-none-any.whl
| Download URL | vision_agents_plugins_silero-0.1.11-py3-none-any.whl |
|---|---|
| Size | 22.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5205a9fcd47dc30a29a54cd457c9ba5f48b73fbeaf53d330ccfc28dd0de952d
|
|
BLAKE2b-256 checksum How to use checksums |
166f61ccfa59e1805a7fbd11beefd9b276a606a501ac85bfb61afcc7ef5af764
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.19
|