diff --git a/core.py b/core.py index 1871597d..9a20d028 100644 --- a/core.py +++ b/core.py @@ -26,8 +26,8 @@ # Get TTS Voices -> https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=6A5AA1D4EAFF4E9FB37E23D68491D6F4 @lru_cache(maxsize=1) # Cache only one result since the file is static def load_voices_data(): - with open(os.path.join("rvc", "lib", "tools", "tts_voices.json")) as f: - return json.load(f) + with open(os.path.join("rvc", "lib", "tools", "tts_voices.json"), "r", encoding="utf-8") as file: + return json.load(file) voices_data = load_voices_data() diff --git a/tabs/tts/tts.py b/tabs/tts/tts.py index abc04c83..225e1fcd 100644 --- a/tabs/tts/tts.py +++ b/tabs/tts/tts.py @@ -22,10 +22,9 @@ i18n = I18nAuto() -json_path = os.path.join("rvc", "lib", "tools", "tts_voices.json") default_weight = random.choice(names) if names else "" -with open(json_path, "r") as file: +with open(os.path.join("rvc", "lib", "tools", "tts_voices.json"), "r", encoding="utf-8") as file: tts_voices_data = json.load(file) short_names = [voice.get("ShortName", "") for voice in tts_voices_data]