cnph001 commited on
Commit
6d2141a
·
verified ·
1 Parent(s): 33785f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -202,7 +202,7 @@ async def process_transcript_line(line, default_voice, rate, pitch):
202
  audio_path = await generate_audio_with_voice_prefix(part, default_voice, rate, pitch) # Process unquoted text with default voice
203
  if audio_path:
204
  audio_segments.append(audio_path)
205
-
206
  return start_time_ms, audio_segments
207
  return None, None
208
 
@@ -227,6 +227,7 @@ async def transcript_to_speech(transcript_text, voice, rate, pitch):
227
  audio = AudioSegment.from_mp3(path)
228
  audio = strip_silence(audio, silence_thresh=-40, min_silence_len=100)
229
  combined_line_audio += audio
 
230
  os.remove(path)
231
  except FileNotFoundError:
232
  print(f"Warning: Audio file not found: {path}")
 
202
  audio_path = await generate_audio_with_voice_prefix(part, default_voice, rate, pitch) # Process unquoted text with default voice
203
  if audio_path:
204
  audio_segments.append(audio_path)
205
+
206
  return start_time_ms, audio_segments
207
  return None, None
208
 
 
227
  audio = AudioSegment.from_mp3(path)
228
  audio = strip_silence(audio, silence_thresh=-40, min_silence_len=100)
229
  combined_line_audio += audio
230
+ combined_line_audio = strip_silence(combined_line_audio, silence_thresh=-40, min_silence_len=100)
231
  os.remove(path)
232
  except FileNotFoundError:
233
  print(f"Warning: Audio file not found: {path}")