Spaces:
Sleeping
Sleeping
GabrielSalem
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ async def text_to_speech(text, voice, rate, pitch):
|
|
15 |
return None, "Please select a voice."
|
16 |
|
17 |
voice_short_name = voice.split(" - ")[0]
|
18 |
-
rate_str = f"
|
19 |
-
pitch_str = f"
|
20 |
communicate = edge_tts.Communicate(text, voice_short_name, rate=rate_str, pitch=pitch_str)
|
21 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
|
22 |
tmp_path = tmp_file.name
|
|
|
15 |
return None, "Please select a voice."
|
16 |
|
17 |
voice_short_name = voice.split(" - ")[0]
|
18 |
+
rate_str = f"{0:+d}%"
|
19 |
+
pitch_str = f"{0:+d}Hz"
|
20 |
communicate = edge_tts.Communicate(text, voice_short_name, rate=rate_str, pitch=pitch_str)
|
21 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
|
22 |
tmp_path = tmp_file.name
|