Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

1. support voice preview 2, update version to 1.1.6

harry6de3d6eedce0
diff --git a/app/config/config.py b/app/config/config.py
index 1d53c1f0..ee10fb60 100644
--- a/app/config/config.py
+++ b/app/config/config.py
@@ -56,7 +56,7 @@ listen_port = _cfg.get("listen_port", 8080)
project_name = _cfg.get("project_name", "MoneyPrinterTurbo")
project_description = _cfg.get("project_description",
"<a href='https://github.com/harry0703/MoneyPrinterTurbo'>https://github.com/harry0703/MoneyPrinterTurbo</a>")
-project_version = _cfg.get("project_version", "1.1.5")
+project_version = _cfg.get("project_version", "1.1.6")
reload_debug = False
imagemagick_path = app.get("imagemagick_path", "")
diff --git a/app/services/voice.py b/app/services/voice.py
index 5474fac9..26118356 100644
--- a/app/services/voice.py
+++ b/app/services/voice.py
@@ -1035,6 +1035,7 @@ def tts(text: str, voice_name: str, voice_file: str) -> [SubMaker, None]:
def azure_tts_v1(text: str, voice_name: str, voice_file: str) -> [SubMaker, None]:
+ voice_name = parse_voice_name(voice_name)
text = text.strip()
for i in range(3):
try:
diff --git a/webui/Main.py b/webui/Main.py
index 307fd0c0..857ee733 100644
--- a/webui/Main.py
+++ b/webui/Main.py
@@ -416,6 +416,10 @@ with middle_panel:
index=0)
with st.container(border=True):
st.write(tr("Audio Settings"))
+
+ # tts_providers = ['edge', 'azure']
+ # tts_provider = st.selectbox(tr("TTS Provider"), tts_providers)
+
voices = voice.get_all_azure_voices(
filter_locals=support_locales)
friendly_names = {
@@ -442,6 +446,26 @@ with middle_panel:
params.voice_name = voice_name
config.ui['voice_name'] = voice_name
+ if st.button(tr("Play Voice")):
+ play_content = params.video_subject
+ if not play_content:
+ play_content = params.video_script
+ if not play_content:
+ play_content = tr("Voice Example")
+ with st.spinner(tr("Synthesizing Voice")):
+ temp_dir = utils.storage_dir("temp", create=True)
+ audio_file = os.path.join(temp_dir, f"tmp-voice-{str(uuid4())}.mp3")
+ sub_maker = voice.tts(text=play_content, voice_name=voice_name, voice_file=audio_file)
+ # if the voice file generation failed, try again with a default content.
+ if not sub_maker:
+ play_content = "This is a example voice. if you hear this, the voice synthesis failed with the original content."
+ sub_maker = voice.tts(text=play_content, voice_name=voice_name, voice_file=audio_file)
+
+ if sub_maker and os.path.exists(audio_file):
+ st.audio(audio_file, format="audio/mp3")
+ if os.path.exists(audio_file):
+ os.remove(audio_file)
+
if voice.is_azure_v2_voice(voice_name):
saved_azure_speech_region = config.azure.get(f"speech_region", "")
saved_azure_speech_key = config.azure.get(f"speech_key", "")
diff --git a/webui/i18n/de.json b/webui/i18n/de.json
index 4a4cfd4a..d3c5be99 100644
--- a/webui/i18n/de.json
+++ b/webui/i18n/de.json
@@ -66,6 +66,10 @@
"TikTok": "TikTok (TikTok support is coming soon)",
"Bilibili": "Bilibili (Bilibili support is coming soon)",
"Xiaohongshu": "Xiaohongshu (Xiaohongshu support is coming soon)",
- "Local file": "Local file"
+ "Local file": "Local file",
+ "Play Voice": "Play Voice",
+ "Voice Example": "This is an example text for testing speech synthesis",
+ "Synthesizing Voice": "Synthesizing voice, please wait...",
+ "TTS Provider": "Select the voice synthesis provider"
}
}
\ No newline at end of file
diff --git a/webui/i18n/en.json b/webui/i18n/en.json
index 5136b927..29336651 100644
--- a/webui/i18n/en.json
+++ b/webui/i18n/en.json
@@ -67,6 +67,10 @@
"TikTok": "TikTok (TikTok support is coming soon)",
"Bilibili": "Bilibili (Bilibili support is coming soon)",
"Xiaohongshu": "Xiaohongshu (Xiaohongshu support is coming soon)",
- "Local file": "Local file"
+ "Local file": "Local file",
+ "Play Voice": "Play Voice",
+ "Voice Example": "This is an example text for testing speech synthesis",
+ "Synthesizing Voice": "Synthesizing voice, please wait...",
+ "TTS Provider": "Select the voice synthesis provider"
}
}
\ No newline at end of file
diff --git a/webui/i18n/vi.json b/webui/i18n/vi.json
index e9be295d..45a510bc 100644
--- a/webui/i18n/vi.json
+++ b/webui/i18n/vi.json
@@ -67,6 +67,10 @@
"TikTok": "TikTok (TikTok support is coming soon)",
"Bilibili": "Bilibili (Bilibili support is coming soon)",
"Xiaohongshu": "Xiaohongshu (Xiaohongshu support is coming soon)",
- "Local file": "Local file"
+ "Local file": "Local file",
+ "Play Voice": "Play Voice",
+ "Voice Example": "This is an example text for testing speech synthesis",
+ "Synthesizing Voice": "Synthesizing voice, please wait...",
+ "TTS Provider": "Select the voice synthesis provider"
}
}
diff --git a/webui/i18n/zh.json b/webui/i18n/zh.json
index 3702f168..d7e596b0 100644
--- a/webui/i18n/zh.json
+++ b/webui/i18n/zh.json
@@ -67,6 +67,10 @@
"TikTok": "抖音 (TikTok 支持中,敬请期待)",
"Bilibili": "哔哩哔哩 (Bilibili 支持中,敬请期待)",
"Xiaohongshu": "小红书 (Xiaohongshu 支持中,敬请期待)",
- "Local file": "本地文件"
+ "Local file": "本地文件",
+ "Play Voice": "试听语音合成",
+ "Voice Example": "这是一段测试语音合成的示例文本",
+ "Synthesizing Voice": "语音合成中,请稍候...",
+ "TTS Provider": "语音合成提供商"
}
}
\ No newline at end of file