diff --git a/config.py b/config.py index 6dd198a9..8d2740aa 100644 --- a/config.py +++ b/config.py @@ -17,7 +17,7 @@ MAX_TARGET_LANGUAGE_LENGTH = 30 # SoVITS角色配置 -DUBBNING_CHARACTER = 'Huanyu' +DUBBING_CHARACTER = 'Huanyu' # 视频分辨率 RESOLUTIOM = '854x480' diff --git a/core/step10_generate_audio.py b/core/step10_generate_audio.py index d93fdb47..5e67c38e 100644 --- a/core/step10_generate_audio.py +++ b/core/step10_generate_audio.py @@ -93,10 +93,10 @@ def process_sovits_tasks(): print(f"文件 {output_file} 已存在,跳过处理") continue - from config import step9_trim_model, DUBBNING_CHARACTER + from config import step9_trim_model, DUBBING_CHARACTER for attempt in range(3): # 尝试三次 try: - generate_audio(text, DUBBNING_CHARACTER, duration, output_file, number) + generate_audio(text, DUBBING_CHARACTER, duration, output_file, number) break # 如果生成音频成功,跳出循环 except Exception as e: if attempt < 2: # 第一次和第二次尝试 diff --git a/st_components/sidebar_setting.py b/st_components/sidebar_setting.py index 12df629b..8877408e 100644 --- a/st_components/sidebar_setting.py +++ b/st_components/sidebar_setting.py @@ -64,9 +64,9 @@ def page_setting(): changes["RESOLUTIOM"] = resolution st.header("SoVITS 角色配置") - dubbing_character = st.text_input("配音角色:", value=config.DUBBNING_CHARACTER) - if dubbing_character != config.DUBBNING_CHARACTER: - changes["DUBBNING_CHARACTER"] = dubbing_character + dubbing_character = st.text_input("配音角色:", value=config.DUBBING_CHARACTER) + if dubbing_character != config.DUBBING_CHARACTER: + changes["DUBBING_CHARACTER"] = dubbing_character if changes: st.toast("记得点击下方的'保存设置'按钮", icon="🔔")