bgm音量支持配置

This commit is contained in:
puke
2025-11-13 20:06:01 +08:00
parent 0d5bf4e61f
commit 25f5a54694
3 changed files with 20 additions and 0 deletions

View File

@@ -457,6 +457,21 @@ def main():
label_visibility="collapsed"
)
# BGM volume slider (only show when BGM is selected)
if bgm_choice != tr("bgm.none"):
bgm_volume = st.slider(
tr("bgm.volume"),
min_value=0.0,
max_value=0.5,
value=0.2,
step=0.01,
format="%.2f",
key="bgm_volume_slider",
help=tr("bgm.volume_help")
)
else:
bgm_volume = 0.2 # Default value when no BGM selected
# BGM preview button (only if BGM is not "None")
if bgm_choice != tr("bgm.none"):
if st.button(tr("bgm.preview"), key="preview_bgm", use_container_width=True):
@@ -1280,6 +1295,7 @@ def main():
"frame_template": frame_template,
"prompt_prefix": prompt_prefix,
"bgm_path": bgm_path,
"bgm_volume": bgm_volume if bgm_path else 0.2,
"progress_callback": update_progress,
}

View File

@@ -126,6 +126,8 @@
"bgm.selector": "Music Selection",
"bgm.none": "🔇 No BGM",
"bgm.volume": "Volume",
"bgm.volume_help": "Adjust background music volume (0.0 = muted, 1.0 = original volume)",
"bgm.preview": "▶ Preview Music",
"bgm.preview_failed": "❌ Music file not found: {file}",
"bgm.what": "Adds background music to your video, making it more atmospheric and professional",

View File

@@ -126,6 +126,8 @@
"bgm.selector": "音乐选择",
"bgm.none": "🔇 无背景音乐",
"bgm.volume": "音量",
"bgm.volume_help": "调整背景音乐的音量0.0 = 静音1.0 = 原始音量)",
"bgm.preview": "▶ 试听音乐",
"bgm.preview_failed": "❌ 音乐文件未找到:{file}",
"bgm.what": "为视频添加背景音乐,让视频更有氛围感和专业性",