cnph001 commited on
Commit
6afb2ee
·
verified ·
1 Parent(s): e25395e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -21,9 +21,10 @@ async def paragraph_to_speech(text, voice, rate, pitch):
21
  voice_short_name =voice2.split(" - ")[0]
22
  else:
23
  voice_short_name = voice.split(" - ")[0]
 
24
  rate_str = f"{rate:+d}%"
25
  pitch_str = f"{pitch:+d}Hz"
26
- communicate = edge_tts.Communicate(text, voice_short_name, rate=rate_str, pitch=pitch_str)
27
  with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
28
  tmp_path = tmp_file.name
29
  await communicate.save(tmp_path)
 
21
  voice_short_name =voice2.split(" - ")[0]
22
  else:
23
  voice_short_name = voice.split(" - ")[0]
24
+ text2=text
25
  rate_str = f"{rate:+d}%"
26
  pitch_str = f"{pitch:+d}Hz"
27
+ communicate = edge_tts.Communicate(text2, voice_short_name, rate=rate_str, pitch=pitch_str)
28
  with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_file:
29
  tmp_path = tmp_file.name
30
  await communicate.save(tmp_path)