Update app.py
Browse files
app.py
CHANGED
|
@@ -854,7 +854,7 @@ def srt_process(srt_path, Language="American English", voice_name="af_bella", tr
|
|
| 854 |
output_path = get_subtitle_Dub_path(srt_path, Language)
|
| 855 |
|
| 856 |
SRTDubbing(use_ffmpeg, ffmpeg_path).srt_to_dub(processed_srt, output_path, Language, voice_name)
|
| 857 |
-
return output_path
|
| 858 |
|
| 859 |
def subtitle_ui():
|
| 860 |
with gr.Blocks() as demo:
|
|
@@ -889,6 +889,7 @@ def subtitle_ui():
|
|
| 889 |
|
| 890 |
with gr.Column():
|
| 891 |
audio = gr.Audio(interactive=False, label='Output Audio', autoplay=True)
|
|
|
|
| 892 |
with gr.Accordion('Enable Autoplay', open=False):
|
| 893 |
autoplay = gr.Checkbox(value=True, label='Autoplay')
|
| 894 |
autoplay.change(toggle_autoplay, inputs=[autoplay], outputs=[audio])
|
|
@@ -901,7 +902,7 @@ def subtitle_ui():
|
|
| 901 |
generate_btn_.click(
|
| 902 |
srt_process,
|
| 903 |
inputs=[srt_file,language_name,voice,translate_text],
|
| 904 |
-
outputs=[audio]
|
| 905 |
)
|
| 906 |
return demo
|
| 907 |
|
|
|
|
| 854 |
output_path = get_subtitle_Dub_path(srt_path, Language)
|
| 855 |
|
| 856 |
SRTDubbing(use_ffmpeg, ffmpeg_path).srt_to_dub(processed_srt, output_path, Language, voice_name)
|
| 857 |
+
return output_path,output_path
|
| 858 |
|
| 859 |
def subtitle_ui():
|
| 860 |
with gr.Blocks() as demo:
|
|
|
|
| 889 |
|
| 890 |
with gr.Column():
|
| 891 |
audio = gr.Audio(interactive=False, label='Output Audio', autoplay=True)
|
| 892 |
+
audio_file = gr.File(label='📥 Download Audio')
|
| 893 |
with gr.Accordion('Enable Autoplay', open=False):
|
| 894 |
autoplay = gr.Checkbox(value=True, label='Autoplay')
|
| 895 |
autoplay.change(toggle_autoplay, inputs=[autoplay], outputs=[audio])
|
|
|
|
| 902 |
generate_btn_.click(
|
| 903 |
srt_process,
|
| 904 |
inputs=[srt_file,language_name,voice,translate_text],
|
| 905 |
+
outputs=[audio,audio_file]
|
| 906 |
)
|
| 907 |
return demo
|
| 908 |
|