Fix reading file encoding with UTF-8 (#130)

This commit is contained in:
Mohaidoss
2025-09-01 10:17:51 +02:00
committed by GitHub
parent ada17799b8
commit 263ed6ac04
2 changed files with 2 additions and 2 deletions

View File

@@ -131,7 +131,7 @@ def main():
print("Enter text to synthesize (Ctrl+D to end input):")
text_to_tts = sys.stdin.read().strip()
else:
with open(args.inp, "r") as fobj:
with open(args.inp, "r", encoding="utf-8") as fobj:
text_to_tts = fobj.read().strip()
all_entries = [tts_model.prepare_script([text_to_tts])]

View File

@@ -63,7 +63,7 @@ def main():
print("Enter text to synthesize (Ctrl+D to end input):")
text = sys.stdin.read().strip()
else:
with open(args.inp, "r") as fobj:
with open(args.inp, "r", encoding="utf-8") as fobj:
text = fobj.read().strip()
# If you want to make a dialog, you can pass more than one turn [text_speaker_1, text_speaker_2, text_2_speaker_1, ...]