Skip to content

Commit 424f484

Browse files
committed
fixed align() missing nonspeech
-fixed `align()` not predicting nonspeech timings for the new section after it skips a nonspeech section due to `nonspeech_skip`; this can lead to missing nonspeech timings if next audio section does not completely overlap the new section (such as in #319 (comment))
1 parent 00ad4b4 commit 424f484

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stable_whisper/alignment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ def redo_words(_idx: int = None):
422422
audio_segment = audio.next_chunk(seek_sample, N_SAMPLES)
423423
if audio_segment is None:
424424
break
425+
nonspeech_predictor.predict(audio=audio_segment, offset=time_offset)
425426
if len(nonspeech_starts) > 1:
426427
new_sample_count = round((nonspeech_starts[1] - nonspeech_ends[0]) * SAMPLE_RATE)
427428
else:

0 commit comments

Comments
 (0)