File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class VadOptions:
3535 """
3636
3737 threshold : float = 0.5
38- neg_threshold : float = threshold - 0.15
38+ neg_threshold : float = None
3939 min_speech_duration_ms : int = 0
4040 max_speech_duration_s : float = float ("inf" )
4141 min_silence_duration_ms : int = 2000
@@ -63,6 +63,7 @@ def get_speech_timestamps(
6363 vad_options = VadOptions (** kwargs )
6464
6565 threshold = vad_options .threshold
66+ neg_threshold = vad_options .neg_threshold
6667 min_speech_duration_ms = vad_options .min_speech_duration_ms
6768 max_speech_duration_s = vad_options .max_speech_duration_s
6869 min_silence_duration_ms = vad_options .min_silence_duration_ms
@@ -90,7 +91,8 @@ def get_speech_timestamps(
9091 triggered = False
9192 speeches = []
9293 current_speech = {}
93- neg_threshold = vad_options .neg_threshold
94+ if neg_threshold is None :
95+ neg_threshold = max (threshold - 0.15 , 0.01 )
9496
9597 # to save potential segment end (and tolerate some silence)
9698 temp_end = 0
You can’t perform that action at this time.
0 commit comments