Repository navigation
Quiet streams: any number of extra quiet detectors on one VAD, each with its own sensitivity. Nothing changes for existing code: without a stream the events are the same as in 0.1.0.
pip install -U realtimevadvad = VAD()
cut = vad.add_stream("cut", offset_db=6.0, quiet_s=0.3) # quiet 6 dB sooner than pause, held for 0.3 s
for event in vad.feed(chunk):
if event.kind == "quiet" and event.stream == "cut":
... # event.quiet.start, .duration
elif event.kind == "sound" and event.stream == "cut":
... # event.quiet.start, .end, .duration
cut.offset_db = 9.0 # any setting, any timeNew
- Quiet streams:
vad.add_stream(name, offset_db=..., quiet_s=..., rearm_s=...)adds one more quiet detector to the sameVAD: its own offset on the quiet thresholdpauseuses, its own minimum length and its own rule for what ends the quiet. A stream reportsquietandsoundevents with where the audio went quiet and for how long. It reuses the instance's levels and noise tracking, so Silero runs once.start,pause,resumeandendare identical with and without streams (20 minutes of meeting audio, event by event). Four streams cost about 0.5 ms per second of audio. README, design note. block_events=True: ablockevent for every 10 ms block with its level, the quiet threshold andover_db, how far the block is from counting as quiet, for callers who want their own rule.benchmarks/quiet_streams.pychecks the equality and measures the cost on your own WAVs.