-
-
Save parzibyte/bdc5cb3db6e00e71e675f8372230a8ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Convertir texto a voz (TTS) con | |
Python usando gTTS | |
Ejemplo 3: Escribir múltiples idiomas en un archivo | |
@author parzibyte | |
""" | |
from gtts import gTTS | |
tts = gTTS('Hola mundo. Estamos convirtiendo texto a voz con Python.', lang='es-us') | |
tts_ingles = gTTS('Hello world! testing tts in Python', lang='en') | |
tts_frances = gTTS('Bonsoir, Elliot', lang='fr-fr') | |
with open("3_hola_es_en_fr.mp3", "wb") as archivo: | |
tts.write_to_fp(archivo) | |
tts_ingles.write_to_fp(archivo) | |
tts_frances.write_to_fp(archivo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment