Skip to content

Commit

Permalink
Handle none type error
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj0517 committed Jan 3, 2025
1 parent 5a73fdb commit 6e1d0e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/vad/silero_vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def get_speech_timestamps(
vad_options = VadOptions(**kwargs)

threshold = vad_options.threshold
neg_threshold = vad_options.neg_threshold
min_speech_duration_ms = vad_options.min_speech_duration_ms
max_speech_duration_s = vad_options.max_speech_duration_s
min_silence_duration_ms = vad_options.min_silence_duration_ms
Expand All @@ -117,7 +118,8 @@ def get_speech_timestamps(
triggered = False
speeches = []
current_speech = {}
neg_threshold = vad_options.neg_threshold
if neg_threshold is 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 6e1d0e6

Please sign in to comment.