Skip to content

Commit

Permalink
Fix typo in SubMaker's feed() logic (#331)
Browse files Browse the repository at this point in the history
The start time should be the offset and the end time is
offset + duration.

Signed-off-by: rany <[email protected]>
  • Loading branch information
rany2 authored Nov 23, 2024
1 parent 1442154 commit 17e5146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/edge_tts/submaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
)
Expand Down

0 comments on commit 17e5146

Please sign in to comment.