cnph001 commited on
Commit
3e534e0
·
verified ·
1 Parent(s): fdb31c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -42,7 +42,8 @@ async def get_voices():
42
  # Text-to-speech function for a single paragraph with SS handling
43
  async def paragraph_to_speech(text, voice, rate, pitch):
44
  voice3 ="en-US-BrianMultilingualNeural - en-US (Male)" #good for reading
45
- voice1F ="en-US-EmmaNeural - en-US (Female)"
 
46
  voice2 = "it-IT-GiuseppeMultilingualNeural - it-IT (Male)"
47
  voice2F = "en-US-JennyNeural - en-US (Female)"
48
  voice1 = "en-AU-WilliamNeural - en-AU (Male)"
@@ -81,6 +82,7 @@ async def paragraph_to_speech(text, voice, rate, pitch):
81
  if part.startswith("1F"):
82
  processed_text = part[2:]
83
  current_voice = voice1F.split(" - ")[0]
 
84
  elif part.startswith("2F"):
85
  processed_text = part[2:]
86
  current_voice = voice2F.split(" - ")[0]
@@ -103,7 +105,7 @@ async def paragraph_to_speech(text, voice, rate, pitch):
103
  processed_text = part[2:]
104
  current_voice = voice5.split(" - ")[0]
105
  current_pitch = -30
106
- current_rate = -20
107
  else:
108
  # Use selected voice, or fallback to default
109
  #voice_short_name = (voice or default_voice).split(" - ")[0]
 
42
  # Text-to-speech function for a single paragraph with SS handling
43
  async def paragraph_to_speech(text, voice, rate, pitch):
44
  voice3 ="en-US-BrianMultilingualNeural - en-US (Male)" #good for reading
45
+ #voice1F ="en-US-EmmaNeural - en-US (Female)"
46
+ voice1F ="en-GB-SoniaNeural - en-GB (Female)"
47
  voice2 = "it-IT-GiuseppeMultilingualNeural - it-IT (Male)"
48
  voice2F = "en-US-JennyNeural - en-US (Female)"
49
  voice1 = "en-AU-WilliamNeural - en-AU (Male)"
 
82
  if part.startswith("1F"):
83
  processed_text = part[2:]
84
  current_voice = voice1F.split(" - ")[0]
85
+ current_pitch = 25
86
  elif part.startswith("2F"):
87
  processed_text = part[2:]
88
  current_voice = voice2F.split(" - ")[0]
 
105
  processed_text = part[2:]
106
  current_voice = voice5.split(" - ")[0]
107
  current_pitch = -30
108
+ current_rate = -15
109
  else:
110
  # Use selected voice, or fallback to default
111
  #voice_short_name = (voice or default_voice).split(" - ")[0]