cnph001 commited on
Commit
ea78e53
·
verified ·
1 Parent(s): 7bb271e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -135,9 +135,11 @@ async def generate_audio_with_voice_prefix(text_segment, default_voice, rate, pi
135
 
136
  audio = AudioSegment.from_mp3(audio_path)
137
  if check1:
 
138
  audio = strip_silence(audio, silence_thresh=-40, min_silence_len=100) ##silence between sentences
139
  else:
140
  audio = strip_silence(audio, silence_thresh=-40, min_silence_len=30) ##less silence for mid-sentence segments
 
141
  stripped_path = tempfile.mktemp(suffix=".mp3")
142
  audio.export(stripped_path, format="mp3")
143
  return stripped_path
 
135
 
136
  audio = AudioSegment.from_mp3(audio_path)
137
  if check1:
138
+ print(f"First part of sentence - long silence")
139
  audio = strip_silence(audio, silence_thresh=-40, min_silence_len=100) ##silence between sentences
140
  else:
141
  audio = strip_silence(audio, silence_thresh=-40, min_silence_len=30) ##less silence for mid-sentence segments
142
+ print(f"2nd part of sentence - long silence")
143
  stripped_path = tempfile.mktemp(suffix=".mp3")
144
  audio.export(stripped_path, format="mp3")
145
  return stripped_path