Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -262,12 +262,16 @@ async def transcript_to_speech(transcript_text, voice, rate, pitch):
|
|
262 |
if not timed_audio_segments:
|
263 |
return None, "No processable audio segments found."
|
264 |
|
|
|
265 |
final_audio = AudioSegment.silent(duration=max_end_time_ms, frame_rate=24000)
|
266 |
for segment in timed_audio_segments:
|
267 |
final_audio = final_audio.overlay(segment['audio'], position=segment['start'])
|
268 |
|
269 |
combined_audio_path = tempfile.mktemp(suffix=".mp3")
|
270 |
final_audio.export(combined_audio_path, format="mp3")
|
|
|
|
|
|
|
271 |
return combined_audio_path, None
|
272 |
|
273 |
@spaces.GPU
|
|
|
262 |
if not timed_audio_segments:
|
263 |
return None, "No processable audio segments found."
|
264 |
|
265 |
+
print(f"Combining Audio - final stage.")
|
266 |
final_audio = AudioSegment.silent(duration=max_end_time_ms, frame_rate=24000)
|
267 |
for segment in timed_audio_segments:
|
268 |
final_audio = final_audio.overlay(segment['audio'], position=segment['start'])
|
269 |
|
270 |
combined_audio_path = tempfile.mktemp(suffix=".mp3")
|
271 |
final_audio.export(combined_audio_path, format="mp3")
|
272 |
+
global default_voice_short # Use the global variable
|
273 |
+
default_voice_short=""
|
274 |
+
print(f"Job done! reset voice back to default.")
|
275 |
return combined_audio_path, None
|
276 |
|
277 |
@spaces.GPU
|