cnph001 commited on
Commit
54191b7
·
verified ·
1 Parent(s): 13280d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ async def get_voices():
13
 
14
  # Text-to-speech function for a single paragraph
15
  async def paragraph_to_speech(text, voice, rate, pitch):
16
- voice1 = "en-HK-SamNeural - en-HK (Male)"
17
  voice2 = "en-HK-YanNeural - en-HK (Female)"
18
  if not text.strip():
19
  return None
@@ -21,7 +21,7 @@ async def paragraph_to_speech(text, voice, rate, pitch):
21
  text2 = text[2:] # Remove the first two characters ("FF")
22
  voice_short_name =voice2.split(" - ")[0]
23
  else:
24
- voice_short_name = voice.split(" - ")[0]
25
  text2=text
26
  rate_str = f"{rate:+d}%"
27
  pitch_str = f"{pitch:+d}Hz"
 
13
 
14
  # Text-to-speech function for a single paragraph
15
  async def paragraph_to_speech(text, voice, rate, pitch):
16
+ voice1 = "en-AU-WilliamNeural - en-AU (Male)"
17
  voice2 = "en-HK-YanNeural - en-HK (Female)"
18
  if not text.strip():
19
  return None
 
21
  text2 = text[2:] # Remove the first two characters ("FF")
22
  voice_short_name =voice2.split(" - ")[0]
23
  else:
24
+ voice_short_name = voice1.split(" - ")[0]
25
  text2=text
26
  rate_str = f"{rate:+d}%"
27
  pitch_str = f"{pitch:+d}Hz"