From 599d1ed99c8611e8f44bf8040c586c69c89dc6ba Mon Sep 17 00:00:00 2001 From: James Vong Date: Sun, 5 Apr 2026 16:20:24 -0700 Subject: [PATCH] Fix double-counted chunk offset in ExtractWordsFromAudio When ChunkEvents splits audio into chunks pointing to the same WAV file, each chunk has offset > 0 marking its position in the file. ExtractWordsFromAudio was using += start + offset, but whisperx times are already relative to the file start, so the correct conversion is += start - offset. This caused word timestamps to be inflated by 2x the offset for chunks after the first, which also inflated the CategoricalEvent duration, producing ~2x too many segments and a wrong time axis for any input longer than 60 seconds. --- tribev2/eventstransforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tribev2/eventstransforms.py b/tribev2/eventstransforms.py index 1fd0c69b..57e7c08f 100644 --- a/tribev2/eventstransforms.py +++ b/tribev2/eventstransforms.py @@ -202,7 +202,7 @@ def _run(self, events: pd.DataFrame) -> pd.DataFrame: transcript.loc[:, k] = v transcript["type"] = "Word" transcript["language"] = self.language - transcript["start"] += audio_event.start + audio_event.offset + transcript["start"] += audio_event.start - audio_event.offset all_transcripts.append(transcript) if all_transcripts: