chore: handle empty segments_list case in silero

prevent errors
This commit is contained in:
tan90xx
2025-01-19 21:20:56 +08:00
committed by GitHub
parent 355f8e06f7
commit de0d8fe313

View File

@ -59,4 +59,8 @@ class Silero(Vad):
offset: Optional[float] = None,
):
assert chunk_size > 0
if len(segments_list) == 0:
print("No active speech found in audio")
return []
assert segments_list, "segments_list is empty."
return Vad.merge_chunks(segments, chunk_size, onset, offset)