import os from gtts import gTTS print("📝 Escribe o pega tu texto de presentación. Termina con Enter + Ctrl+D (en Linux):\n") # Leer texto completo desde stdin try: texto = "" while True: linea = input() texto += linea + "\n" except EOFError: pass # Guardar texto with open("guion.txt", "w", encoding="utf-8") as f: f.write(texto) # Convertir a voz tts = gTTS(text=texto, lang="es") tts.save("guion.mp3") # Reproducir print("🔊 Reproduciendo tu presentación con voz generada...") os.system("mpg123 guion.mp3 || ffplay -nodisp -autoexit guion.mp3")