From f40bb6b5548f113f87ac92250e6dc27ffaff217e Mon Sep 17 00:00:00 2001 From: ls-milkyway <55090624+ls-milkyway@users.noreply.github.com> Date: Sun, 20 Feb 2022 23:11:34 +0530 Subject: [PATCH] Update test_srt.py 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. --- python/example/test_srt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/example/test_srt.py b/python/example/test_srt.py index 0a1747ff..0fe5643e 100755 --- a/python/example/test_srt.py +++ b/python/example/test_srt.py @@ -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()