hivecorp commited on
Commit
d2e42c0
·
verified ·
1 Parent(s): 2f20851

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -118,7 +118,7 @@ async def batch_process_srt_and_audio(script_text, pitch, rate, voice, progress=
118
  # Gradio interface function
119
  async def process_script(script_text, pitch, rate, voice):
120
  # Format pitch correctly for edge-tts
121
- pitch_str = f"{pitch}Hz" if pitch != 0 else "+1Hz"
122
  formatted_rate = f"{'+' if rate > 0 else ''}{int(rate)}%"
123
  srt_path, audio_path = await batch_process_srt_and_audio(script_text, pitch_str, formatted_rate, voice_options[voice])
124
  return srt_path, audio_path, audio_path
@@ -169,8 +169,8 @@ app = gr.Interface(
169
  fn=process_script,
170
  inputs=[
171
  gr.Textbox(label="Enter Script Text", lines=10),
172
- gr.Slider(label="Pitch Adjustment (Hz)", minimum=-100, maximum=+100, step=+1, value=1),
173
- gr.Slider(label="Rate Adjustment (%)", minimum=-100, maximum=+100, step=+1, value=1),
174
  gr.Dropdown(label="Select Voice", choices=list(voice_options.keys()), value="Andrew"),
175
  ],
176
  outputs=[
 
118
  # Gradio interface function
119
  async def process_script(script_text, pitch, rate, voice):
120
  # Format pitch correctly for edge-tts
121
+ pitch_str = f"{pitch}Hz" if pitch != 0 else "-1Hz"
122
  formatted_rate = f"{'+' if rate > 0 else ''}{int(rate)}%"
123
  srt_path, audio_path = await batch_process_srt_and_audio(script_text, pitch_str, formatted_rate, voice_options[voice])
124
  return srt_path, audio_path, audio_path
 
169
  fn=process_script,
170
  inputs=[
171
  gr.Textbox(label="Enter Script Text", lines=10),
172
+ gr.Slider(label="Pitch Adjustment (Hz)", minimum=-20, maximum=20, value=0 step=1,),
173
+ gr.Slider(label="Rate Adjustment (%)", minimum=-50, maximum=50, value=0,step=1),
174
  gr.Dropdown(label="Select Voice", choices=list(voice_options.keys()), value="Andrew"),
175
  ],
176
  outputs=[