Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,15 +73,8 @@ async def generar_tts(texto, voz, duracion_total):
|
|
73 |
if len(texto) > 1000:
|
74 |
texto = texto[:1000]
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
"es-ES-ElviraNeural", "es-MX-JavierNeural",
|
79 |
-
# A帽ade todas las voces v谩lidas aqu铆
|
80 |
-
]
|
81 |
-
if voz not in voces_validas:
|
82 |
-
raise ValueError(f"La voz seleccionada '{voz}' no es v谩lida.")
|
83 |
-
|
84 |
-
logging.info("Generando TTS")
|
85 |
communicate = edge_tts.Communicate(texto, voz)
|
86 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_tts:
|
87 |
await communicate.save(tmp_tts.name)
|
@@ -194,7 +187,7 @@ async def procesar_video(video_input, texto_tts, voz_seleccionada):
|
|
194 |
video_original.close()
|
195 |
if intro:
|
196 |
intro.close()
|
197 |
-
if otro
|
198 |
outro.close()
|
199 |
for file in temp_files:
|
200 |
try:
|
|
|
73 |
if len(texto) > 1000:
|
74 |
texto = texto[:1000]
|
75 |
|
76 |
+
# Eliminado la validaci贸n restrictiva de voces para permitir todas las que est谩n en el dropdown
|
77 |
+
logging.info(f"Generando TTS con voz: {voz}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
communicate = edge_tts.Communicate(texto, voz)
|
79 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp_tts:
|
80 |
await communicate.save(tmp_tts.name)
|
|
|
187 |
video_original.close()
|
188 |
if intro:
|
189 |
intro.close()
|
190 |
+
if outro: # Corregido: outro en lugar de otro
|
191 |
outro.close()
|
192 |
for file in temp_files:
|
193 |
try:
|