bgm音量支持配置
This commit is contained in:
16
web/app.py
16
web/app.py
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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": "为视频添加背景音乐,让视频更有氛围感和专业性",
|
||||
|
||||
Reference in New Issue
Block a user