Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -364,21 +364,17 @@ async def crear_video_async(prompt_type, input_text, selected_voice, musica_file
|
|
364 |
|
365 |
# 2. Generar audio de voz
|
366 |
voz_path = os.path.join(temp_dir_intermediate, "voz.mp3")
|
367 |
-
tts_voices_to_try = [selected_voice
|
368 |
tts_success = False
|
369 |
-
tried_voices = set()
|
370 |
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
tts_success = await text_to_speech(guion, voz_path, current_voice)
|
377 |
-
if tts_success:
|
378 |
-
break
|
379 |
|
380 |
if not tts_success or not os.path.exists(voz_path) or os.path.getsize(voz_path) <= 100:
|
381 |
-
raise ValueError("Error generando voz
|
382 |
|
383 |
temp_intermediate_files.append(voz_path)
|
384 |
audio_tts_original = AudioFileClip(voz_path)
|
|
|
364 |
|
365 |
# 2. Generar audio de voz
|
366 |
voz_path = os.path.join(temp_dir_intermediate, "voz.mp3")
|
367 |
+
tts_voices_to_try = [selected_voice] # Solo intentar la voz seleccionada
|
368 |
tts_success = False
|
|
|
369 |
|
370 |
+
logger.info(f"Intentando TTS con voz seleccionada: {selected_voice}")
|
371 |
+
tts_success = await text_to_speech(guion, voz_path, selected_voice)
|
372 |
+
if not tts_success:
|
373 |
+
logger.warning(f"Fallo con voz '{selected_voice}'. Intentando voz por defecto: {DEFAULT_VOICE_ID}")
|
374 |
+
tts_success = await text_to_speech(guion, voz_path, DEFAULT_VOICE_ID)
|
|
|
|
|
|
|
375 |
|
376 |
if not tts_success or not os.path.exists(voz_path) or os.path.getsize(voz_path) <= 100:
|
377 |
+
raise ValueError(f"Error generando voz. Intentos con '{selected_voice}' y '{DEFAULT_VOICE_ID}' fallaron.")
|
378 |
|
379 |
temp_intermediate_files.append(voz_path)
|
380 |
audio_tts_original = AudioFileClip(voz_path)
|