cnph001 commited on
Commit
afa248c
·
verified ·
1 Parent(s): aa04639

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -77,7 +77,7 @@ async def generate_audio_with_voice_prefix(text_segment, default_voice, rate, pi
77
  if processed_text.startswith(prefix):
78
  current_voice_short = voice_short
79
  if prefix in ["1F", "3F", "1V", "3V"]:
80
- current_pitch = 25
81
  elif prefix in ["1O", "4V"]:
82
  current_pitch = -20
83
  current_rate = -10
@@ -91,6 +91,7 @@ async def generate_audio_with_voice_prefix(text_segment, default_voice, rate, pi
91
  prefix_pitch = match.group(1)
92
  number = match.group(2)
93
  if prefix_pitch in voice_map:
 
94
  current_pitch += number
95
  #processed_text = re.sub(r'[A-Za-z]+-?\d+', '', processed_text, count=1).strip()
96
  processed_text = re.sub(r'([A-Za-z]+)([-]?\d*)', '', processed_text, count=1).strip()
 
77
  if processed_text.startswith(prefix):
78
  current_voice_short = voice_short
79
  if prefix in ["1F", "3F", "1V", "3V"]:
80
+ current_pitch = 0
81
  elif prefix in ["1O", "4V"]:
82
  current_pitch = -20
83
  current_rate = -10
 
91
  prefix_pitch = match.group(1)
92
  number = match.group(2)
93
  if prefix_pitch in voice_map:
94
+ print(f"Prefix match found: '{prefix_pitch}' and '{number}'") # Debug
95
  current_pitch += number
96
  #processed_text = re.sub(r'[A-Za-z]+-?\d+', '', processed_text, count=1).strip()
97
  processed_text = re.sub(r'([A-Za-z]+)([-]?\d*)', '', processed_text, count=1).strip()