Skip to content

Commit

Permalink
minor changes on tts path
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Oct 2, 2024
1 parent 4f5e57f commit 5839fcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions tabs/tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 5839fcb

Please sign in to comment.