Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 "
|
| 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=-
|
| 173 |
-
gr.Slider(label="Rate Adjustment (%)", minimum=-
|
| 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=[
|