From d4771e563e10cdb6487e5f205492bb5e1f97d9dd Mon Sep 17 00:00:00 2001 From: Quentin Fuxa Date: Wed, 13 Aug 2025 10:04:00 +0200 Subject: [PATCH] Increase END_SILENCE_DURATION to reduce false positives --- whisperlivekit/remove_silences.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/whisperlivekit/remove_silences.py b/whisperlivekit/remove_silences.py index e32f2c7..4db095b 100644 --- a/whisperlivekit/remove_silences.py +++ b/whisperlivekit/remove_silences.py @@ -2,6 +2,7 @@ from whisperlivekit.timed_objects import ASRToken import re MIN_SILENCE_DURATION = 4 #in seconds +END_SILENCE_DURATION = 8 #in seconds. you should keep it important to not have false positive when the model lag is important def blank_to_silence(tokens): full_string = ''.join([t.text for t in tokens]) @@ -79,7 +80,7 @@ def ends_with_silence(tokens, current_time): if not tokens: return [] last_token = tokens[-1] - if tokens and current_time - last_token.end >= MIN_SILENCE_DURATION: + if tokens and current_time - last_token.end >= END_SILENCE_DURATION: if last_token.speaker == -2: last_token.end = current_time else: