Skip to content

Commit

Permalink
Fix neg_threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
Purfview authored Dec 7, 2024
1 parent e351399 commit df854d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions faster_whisper/vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class VadOptions:
"""

threshold: float = 0.5
neg_threshold: float = threshold - 0.15
neg_threshold: float = None
min_speech_duration_ms: int = 0
max_speech_duration_s: float = float("inf")
min_silence_duration_ms: int = 2000
Expand Down Expand Up @@ -91,7 +91,8 @@ def get_speech_timestamps(
triggered = False
speeches = []
current_speech = {}
neg_threshold = max(neg_threshold, 0.01)
if neg_threshold == None:
neg_threshold = max(threshold - 0.15, 0.01)

# to save potential segment end (and tolerate some silence)
temp_end = 0
Expand Down

0 comments on commit df854d1

Please sign in to comment.