Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,8 +16,8 @@ async def text_to_speech(text, voice, rate, pitch):
|
|
| 16 |
return None, "Please select a voice."
|
| 17 |
|
| 18 |
voice_short_name = voice.split(" - ")[0]
|
| 19 |
-
rate_str = f"
|
| 20 |
-
pitch_str = f"
|
| 21 |
communicate = edge_tts.Communicate(text, voice_short_name, rate=rate_str, pitch=pitch_str)
|
| 22 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
|
| 23 |
tmp_path = tmp_file.name
|
|
@@ -40,14 +40,14 @@ async def create_demo():
|
|
| 40 |
inputs=[
|
| 41 |
gr.Textbox(label="Text", lines=5),
|
| 42 |
gr.Dropdown(choices=[""] + list(voices.keys()), label="Stimme", value=""),
|
| 43 |
-
gr.Slider(minimum=-50, maximum=50, value=0, label="Speech Rate Adjustment (%)", step=1),
|
| 44 |
-
gr.Slider(minimum=-20, maximum=20, value=0, label="Pitch Adjustment (Hz)", step=1)
|
| 45 |
],
|
| 46 |
outputs=[
|
| 47 |
gr.Audio(label="Generated Audio", type="filepath"),
|
| 48 |
gr.Markdown(label="Warning", visible=False)
|
| 49 |
],
|
| 50 |
-
title="Text
|
| 51 |
description=description,
|
| 52 |
article="",
|
| 53 |
analytics_enabled=False,
|
|
|
|
| 16 |
return None, "Please select a voice."
|
| 17 |
|
| 18 |
voice_short_name = voice.split(" - ")[0]
|
| 19 |
+
rate_str = f"+0%"
|
| 20 |
+
pitch_str = f"+0Hz"
|
| 21 |
communicate = edge_tts.Communicate(text, voice_short_name, rate=rate_str, pitch=pitch_str)
|
| 22 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
|
| 23 |
tmp_path = tmp_file.name
|
|
|
|
| 40 |
inputs=[
|
| 41 |
gr.Textbox(label="Text", lines=5),
|
| 42 |
gr.Dropdown(choices=[""] + list(voices.keys()), label="Stimme", value=""),
|
| 43 |
+
#gr.Slider(minimum=-50, maximum=50, value=0, label="Speech Rate Adjustment (%)", step=1),
|
| 44 |
+
#gr.Slider(minimum=-20, maximum=20, value=0, label="Pitch Adjustment (Hz)", step=1)
|
| 45 |
],
|
| 46 |
outputs=[
|
| 47 |
gr.Audio(label="Generated Audio", type="filepath"),
|
| 48 |
gr.Markdown(label="Warning", visible=False)
|
| 49 |
],
|
| 50 |
+
title="Text in mp3-Sprachdatei umwandeln",
|
| 51 |
description=description,
|
| 52 |
article="",
|
| 53 |
analytics_enabled=False,
|