Update app.py
Browse files
app.py
CHANGED
@@ -623,7 +623,51 @@ def srt_process(srt_file_path,voice_name,custom_voicepack=None,dest_language="en
|
|
623 |
|
624 |
|
625 |
|
|
|
626 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
627 |
|
628 |
|
629 |
|
|
|
623 |
|
624 |
|
625 |
|
626 |
+
with gr.Blocks() as demo3:
|
627 |
|
628 |
+
gr.Markdown(
|
629 |
+
"""
|
630 |
+
# Generate Audio File From Subtitle [Upload Only .srt file]
|
631 |
+
|
632 |
+
To generate subtitles, you can use the [Whisper Turbo Subtitle](https://github.com/NeuralFalconYT/Whisper-Turbo-Subtitle)
|
633 |
+
|
634 |
+
[](https://colab.research.google.com/github/NeuralFalconYT/Whisper-Turbo-Subtitle/blob/main/Whisper_Turbo_Subtitle.ipynb)
|
635 |
+
"""
|
636 |
+
)
|
637 |
+
with gr.Row():
|
638 |
+
with gr.Column():
|
639 |
+
srt_file = gr.File(label='Upload .srt Subtitle File Only')
|
640 |
+
with gr.Row():
|
641 |
+
voice = gr.Dropdown(
|
642 |
+
voice_list,
|
643 |
+
value='af_bella',
|
644 |
+
allow_custom_value=False,
|
645 |
+
label='Voice',
|
646 |
+
)
|
647 |
+
with gr.Row():
|
648 |
+
generate_btn_ = gr.Button('Generate', variant='primary')
|
649 |
+
|
650 |
+
with gr.Accordion('Audio Settings', open=False):
|
651 |
+
custom_voicepack = gr.File(label='Upload Custom VoicePack .pt file')
|
652 |
+
|
653 |
+
|
654 |
+
|
655 |
+
with gr.Column():
|
656 |
+
audio = gr.Audio(interactive=False, label='Output Audio', autoplay=True)
|
657 |
+
with gr.Accordion('Enable Autoplay', open=False):
|
658 |
+
autoplay = gr.Checkbox(value=True, label='Autoplay')
|
659 |
+
autoplay.change(toggle_autoplay, inputs=[autoplay], outputs=[audio])
|
660 |
+
|
661 |
+
# srt_file.submit(
|
662 |
+
# srt_process,
|
663 |
+
# inputs=[srt_file, voice],
|
664 |
+
# outputs=[audio]
|
665 |
+
# )
|
666 |
+
generate_btn_.click(
|
667 |
+
srt_process,
|
668 |
+
inputs=[srt_file,voice,custom_voicepack],
|
669 |
+
outputs=[audio]
|
670 |
+
)
|
671 |
|
672 |
|
673 |
|