cnph001 commited on
Commit
ef4c8b8
·
verified ·
1 Parent(s): 2f9b5de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -70,7 +70,11 @@ async def paragraph_to_speech(text, voice, rate, pitch):
70
  current_voice = voice5.split(" - ")[0]
71
  current_pitch = -30
72
  current_rate = -20
73
-
 
 
 
 
74
  rate_str = f"{current_rate:+d}%"
75
  pitch_str = f"{current_pitch:+d}Hz"
76
  communicate = edge_tts.Communicate(processed_text, current_voice, rate=rate_str, pitch=pitch_str)
 
70
  current_voice = voice5.split(" - ")[0]
71
  current_pitch = -30
72
  current_rate = -20
73
+ else:
74
+ # Use selected voice, or fallback to default
75
+ #voice_short_name = (voice or default_voice).split(" - ")[0]
76
+ current_voice = (voice or default_voice).split(" - ")[0]
77
+ processed_text=part[:]
78
  rate_str = f"{current_rate:+d}%"
79
  pitch_str = f"{current_pitch:+d}Hz"
80
  communicate = edge_tts.Communicate(processed_text, current_voice, rate=rate_str, pitch=pitch_str)