Skip to content

RealtimeVAD 0.1.1

Latest

Choose a tag to compare

@KoljaB KoljaB released this 14 Nov 21:38

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 realtimevad
vad = 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 time

New

  • Quiet streams: vad.add_stream(name, offset_db=..., quiet_s=..., rearm_s=...) adds one more quiet detector to the same VAD: its own offset on the quiet threshold pause uses, its own minimum length and its own rule for what ends the quiet. A stream reports quiet and sound events 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, resume and end are 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: a block event for every 10 ms block with its level, the quiet threshold and over_db, how far the block is from counting as quiet, for callers who want their own rule.
  • benchmarks/quiet_streams.py checks the equality and measures the cost on your own WAVs.