From ff4e797aabeba9444faad5b4788d34c9d68a97f0 Mon Sep 17 00:00:00 2001 From: AWAS666 Date: Mon, 14 Oct 2024 21:11:50 +0200 Subject: [PATCH] feat: speed slider in gradio --- gradio_app.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gradio_app.py b/gradio_app.py index c696443..43ca0e9 100644 --- a/gradio_app.py +++ b/gradio_app.py @@ -402,6 +402,11 @@ def parse_speechtypes_text(gen_text): return segments +def update_speed(new_speed): + global speed + speed = new_speed + return f"Speed set to: {speed}" + with gr.Blocks() as app: gr.Markdown( """ @@ -442,6 +447,15 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip info="Enter custom words to split on, separated by commas. Leave blank to use default list.", lines=2, ) + speed_slider = gr.Slider( + label="Speed", + minimum=0.3, + maximum=2.0, + value=speed, + step=0.1, + info="Adjust the speed of the audio.", + ) + speed_slider.change(update_speed, inputs=speed_slider) audio_output = gr.Audio(label="Synthesized Audio") spectrogram_output = gr.Image(label="Spectrogram")