djanssen79 commited on
Commit
0a06be6
·
verified ·
1 Parent(s): e445d26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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"{rate:+d}%"
20
- pitch_str = f"{pitch:+d}Hz"
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-zu-mp3",
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,