From d3f67642c254094f8d3f1dbdb5776dc89417380b Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Tue, 17 Feb 2026 17:20:36 -0800 Subject: [PATCH] Fix #219: Suppress [BLANK_AUDIO] tokens in whisper.cpp output (#222) - Add suppress_blank=True and suppress_non_speech_tokens=True parameters to whisper.cpp Model initialization to prevent blank audio tokens from being output when transcribing silent audio - This implements Option 2 from the investigation: suppress at the whisper.cpp level rather than post-processing filtering - Root cause: whisper.cpp outputs a special [BLANK_AUDIO] token when transcribing silent audio, which was being inserted into the text field when users paused with the mic on --- src/vocalinux/speech_recognition/recognition_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vocalinux/speech_recognition/recognition_manager.py b/src/vocalinux/speech_recognition/recognition_manager.py index 32727fc..14c93e8 100644 --- a/src/vocalinux/speech_recognition/recognition_manager.py +++ b/src/vocalinux/speech_recognition/recognition_manager.py @@ -633,7 +633,12 @@ class SpeechRecognitionManager: cpu_count = multiprocessing.cpu_count() load_start_time = time.time() - self.model = Model(model_path, n_threads=n_threads) + self.model = Model( + model_path, + n_threads=n_threads, + suppress_blank=True, + suppress_non_speech_tokens=True, + ) load_duration = time.time() - load_start_time logger.info(