From 4569cb982a160689e5b807f03192c01fa01fcc46 Mon Sep 17 00:00:00 2001 From: m-bain <36994049+m-bain@users.noreply.github.com> Date: Thu, 12 Jan 2023 12:57:12 +0000 Subject: [PATCH] fix file_ass display bug sentence start time on .ass files had a bug where if the first word did not have a timestamp, it would set sentence start_time to 0, but this needs to be the local 0 not actual file 0 (i.e. it should be segment['start']) --- whisperx/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisperx/utils.py b/whisperx/utils.py index e7c8c33..56e3483 100644 --- a/whisperx/utils.py +++ b/whisperx/utils.py @@ -193,7 +193,7 @@ def write_ass(transcript: Iterator[dict], file: TextIO, curr_words = [wrd['text'] for wrd in segment['word-level']] prev = segment['word-level'][0]['start'] if prev is None: - prev = 0 + prev = segment['start'] for wdx, word in enumerate(segment['word-level']): if word['start'] is not None: # fill gap between previous word