.wav conversion, handle audio with no detected speech

This commit is contained in:
Max Bain
2023-03-31 23:02:38 +01:00
parent d0fa028045
commit b9ca701d69
5 changed files with 50 additions and 22 deletions

View File

@ -275,7 +275,10 @@ def merge_chunks(segments, chunk_size):
for speech_turn in segments.get_timeline():
segments_list.append(SegmentX(speech_turn.start, speech_turn.end, "UNKNOWN"))
assert segments_list, "segments_list is empty."
if len(segments_list) == 0:
print("No active speech found in audio")
return []
# assert segments_list, "segments_list is empty."
# Make sur the starting point is the start of the segment.
curr_start = segments_list[0].start