From 17e5146606dd12b3c9c5286c2c1bdcb3e6fbc4a0 Mon Sep 17 00:00:00 2001 From: Rany Date: Sat, 23 Nov 2024 13:30:16 +0200 Subject: [PATCH] Fix typo in SubMaker's feed() logic (#331) The start time should be the offset and the end time is offset + duration. Signed-off-by: rany --- src/edge_tts/submaker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/edge_tts/submaker.py b/src/edge_tts/submaker.py index cfcfc03..333fb52 100644 --- a/src/edge_tts/submaker.py +++ b/src/edge_tts/submaker.py @@ -31,8 +31,8 @@ def feed(self, msg: TTSChunk) -> None: self.cues.append( srt.Subtitle( index=len(self.cues) + 1, - start=srt.timedelta(microseconds=msg["duration"] / 10), - end=srt.timedelta(microseconds=(msg["duration"] + msg["offset"]) / 10), + start=srt.timedelta(microseconds=msg["offset"] / 10), + end=srt.timedelta(microseconds=(msg["offset"] + msg["duration"]) / 10), content=msg["text"], ) )