A recording with long pauses wastes time and can produce hallucinated text from the silence. faster-whisper’s voice activity detection, enabled with vad_filter, skips the silent parts, and its vad_parameters set how long a silence must be before it counts. This guide turns the filter on and tunes the silence length.
Before you start
- Python with faster-whisper installed.
- An audio file with clear pauses, for example a meeting with gaps between speakers.
- A terminal and a text editor.
Turn on the voice filter
Enable the filter with default parameters:
from faster_whisper import WhisperModel
model = WhisperModel("base", device="cpu", compute_type="int8")
segments, info = model.transcribe("meeting.wav", vad_filter=True)
for s in segments:
print(s.start, s.text)
The output should have no segments that cover long silences.
Tune the silence length
Set the minimum silence duration, in milliseconds, before a pause is treated as silence:
segments, info = model.transcribe("meeting.wav", vad_filter=True, vad_parameters=dict(min_silence_duration_ms=1000))
The default is 2000 milliseconds. A shorter value skips more pauses but risks cutting the gap inside a slow sentence; a longer value is safer for slow speakers.
Check the speech is intact
Compare the transcript with the recording at a few places where a speaker pauses mid-sentence. The words on both sides of the pause should still be present. If a word is missing, raise the silence duration and run it again.
Worked example
Worked example: a 20-minute meeting with about 3 minutes of silence between turns. With vad_filter on and min_silence_duration_ms=2000, the transcript should cover the same spoken words as without the filter, but the run should finish sooner and the output should contain no hallucinated text in the silent stretches.
Expected result
UNTESTED in this guide: no transcription was run while writing it. The expected result is that the transcript covers all the spoken words, the silent stretches produce no text, and the run finishes faster than without the filter.
Limitations
Too short a silence value can cut the pause between a question and its answer, and the filter can also remove very quiet speech. Listen to a sample of the recording first to judge how quiet the speech gets.
