Skip to content

Commit 17e5146

Browse files
authored
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 <[email protected]>
1 parent 1442154 commit 17e5146

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/edge_tts/submaker.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def feed(self, msg: TTSChunk) -> None:
3131
self.cues.append(
3232
srt.Subtitle(
3333
index=len(self.cues) + 1,
34-
start=srt.timedelta(microseconds=msg["duration"] / 10),
35-
end=srt.timedelta(microseconds=(msg["duration"] + msg["offset"]) / 10),
34+
start=srt.timedelta(microseconds=msg["offset"] / 10),
35+
end=srt.timedelta(microseconds=(msg["offset"] + msg["duration"]) / 10),
3636
content=msg["text"],
3737
)
3838
)

0 commit comments

Comments
 (0)