Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -282,31 +282,27 @@ restart_markdown = ("""
|
|
282 |
""")
|
283 |
|
284 |
with gr.Blocks() as app:
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
inp4 = gr.Checkbox(label="SRT文件是否为双语字幕", info="若为双语字幕,请打勾选择(SRT文件中需要先出现中文字幕,后英文字幕;中英字幕各占一行)")
|
299 |
-
btn = gr.Button("一键开启AI配音吧💕", variant="primary")
|
300 |
-
with gr.Column():
|
301 |
-
out1 = gr.Audio(label="为您生成的AI完整配音", type="filepath")
|
302 |
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
|
312 |
app.launch(show_error=True)
|
|
|
282 |
""")
|
283 |
|
284 |
with gr.Blocks() as app:
|
285 |
+
gr.Markdown("# <center>🌊💕🎶 OpenAI TTS - SRT文件一键AI配音</center>")
|
286 |
+
gr.Markdown("### <center>🌟 只需上传SRT文件和原版配音文件即可,每次一集视频AI自动配音!Developed by Kevin Wang </center>")
|
287 |
+
with gr.Row():
|
288 |
+
with gr.Column():
|
289 |
+
inp0 = gr.Textbox(type='password', label='请输入您的OpenAI API Key')
|
290 |
+
inp1 = gr.File(file_count="single", label="请上传一集视频对应的SRT文件")
|
291 |
+
inp2 = gr.Audio(label="请上传一集视频的配音文件", type="filepath")
|
292 |
+
inp3 = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='请选择一个说话人提供基础音色', info="试听音色链接:https://platform.openai.com/docs/guides/text-to-speech/voice-options", value='alloy')
|
293 |
+
#inp4 = gr.Dropdown(label="请选择用于分离伴奏的模型", info="UVR-HP5去除背景音乐效果更好,但会对人声造成一定的损伤", choices=["UVR-HP2", "UVR-HP5"], value="UVR-HP5")
|
294 |
+
inp4 = gr.Checkbox(label="SRT文件是否为双语字幕", info="若为双语字幕,请打勾选择(SRT文件中需要先出现中文字幕,后英文字幕;中英字幕各占一行)")
|
295 |
+
btn = gr.Button("一键开启AI配音吧💕", variant="primary")
|
296 |
+
with gr.Column():
|
297 |
+
out1 = gr.Audio(label="为您生成的AI完整配音", type="filepath")
|
|
|
|
|
|
|
|
|
298 |
|
299 |
+
btn.click(convert_from_srt, [inp0, inp1, inp2, inp3, inp4], [out1])
|
300 |
+
gr.Markdown("### <center>注意❗:请勿生成会对任何个人或组织造成侵害的内容,请尊重他人的著作权和知识产权。用户对此程序的任何使用行为与程序开发者无关。</center>")
|
301 |
+
gr.HTML('''
|
302 |
+
<div class="footer">
|
303 |
+
<p>🌊🏞️🎶 - 江水东流急,滔滔无尽声。 明·顾璘
|
304 |
+
</p>
|
305 |
+
</div>
|
306 |
+
''')
|
307 |
|
308 |
app.launch(show_error=True)
|