Comment out voice ID creation in generate_voices.py

Commented out the voice ID creation logic for clarity.
This commit is contained in:
mARTin 2026-04-14 21:13:23 +02:00 committed by GitHub
parent 60db1b181f
commit 3f723b4032
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
#generate_voices.py
""" """
Scan the speakers directory for reference audio files and generate voices.json. Scan the speakers directory for reference audio files and generate voices.json.
@ -14,6 +15,7 @@ output_file = "/config/voices.json"
voices = {} voices = {}
# Ensure the directory exists just in case
if os.path.exists(speaker_dir): if os.path.exists(speaker_dir):
for filename in os.listdir(speaker_dir): for filename in os.listdir(speaker_dir):
if filename.endswith((".wav", ".mp3")): if filename.endswith((".wav", ".mp3")):
@ -28,13 +30,13 @@ if os.path.exists(speaker_dir):
elif base_name.startswith("basic_ref_zh"): elif base_name.startswith("basic_ref_zh"):
lang = "Chinese" lang = "Chinese"
# Create a clean voice ID # # Create a clean voice ID
voice_id = base_name.lower() # voice_id = base_name.lower()
prefixes_to_strip = ["en_m_", "en_f_", "de_m_", "de_f_"] # prefixes_to_strip = ["en_m_", "en_f_", "de_m_", "de_f_"]
for prefix in prefixes_to_strip: # for prefix in prefixes_to_strip:
if voice_id.startswith(prefix): # if voice_id.startswith(prefix):
voice_id = voice_id.replace(prefix, "", 1) # voice_id = voice_id.replace(prefix, "", 1)
break # break
entry = { entry = {
"ref_audio": f"/config/speakers/{filename}", "ref_audio": f"/config/speakers/{filename}",