AWAS666 commited on
Commit
ff4e797
·
1 Parent(s): e54fee3

feat: speed slider in gradio

Browse files
Files changed (1) hide show
  1. gradio_app.py +14 -0
gradio_app.py CHANGED
@@ -402,6 +402,11 @@ def parse_speechtypes_text(gen_text):
402
 
403
  return segments
404
 
 
 
 
 
 
405
  with gr.Blocks() as app:
406
  gr.Markdown(
407
  """
@@ -442,6 +447,15 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip
442
  info="Enter custom words to split on, separated by commas. Leave blank to use default list.",
443
  lines=2,
444
  )
 
 
 
 
 
 
 
 
 
445
 
446
  audio_output = gr.Audio(label="Synthesized Audio")
447
  spectrogram_output = gr.Image(label="Spectrogram")
 
402
 
403
  return segments
404
 
405
+ def update_speed(new_speed):
406
+ global speed
407
+ speed = new_speed
408
+ return f"Speed set to: {speed}"
409
+
410
  with gr.Blocks() as app:
411
  gr.Markdown(
412
  """
 
447
  info="Enter custom words to split on, separated by commas. Leave blank to use default list.",
448
  lines=2,
449
  )
450
+ speed_slider = gr.Slider(
451
+ label="Speed",
452
+ minimum=0.3,
453
+ maximum=2.0,
454
+ value=speed,
455
+ step=0.1,
456
+ info="Adjust the speed of the audio.",
457
+ )
458
+ speed_slider.change(update_speed, inputs=speed_slider)
459
 
460
  audio_output = gr.Audio(label="Synthesized Audio")
461
  spectrogram_output = gr.Image(label="Spectrogram")