Skip to content

Commit

Permalink
Update test_srt.py
Browse files Browse the repository at this point in the history
Since SRT files are mostly generated to watch with the video, rather than having an output displayed on the screen ...I propose these changes.
I hope "utf-8" encoding declaration can properly display all the language fonts across all the models in the generated srt file...Please make sure before committing.
  • Loading branch information
ls-milkyway authored Feb 20, 2022
1 parent ad546a8 commit f40bb6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/example/test_srt.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ def transcribe():
end=datetime.timedelta(seconds=line[-1]['end']))
subs.append(s)
return subs

print (srt.compose(transcribe()))
subtitle = open('subtitle.srt', 'w', encoding="utf-8")
print ((srt.compose(transcribe())), file = subtitle)
subtitle.close()

0 comments on commit f40bb6b

Please sign in to comment.