Created
August 24, 2019 12:23
-
-
Save ryanbekabe/9cc7916ae5667568ac3fa53b1febca8f to your computer and use it in GitHub Desktop.
Python Text to Speech
This file contains hidden or 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
import pyttsx3 | |
import engineio | |
engineio = pyttsx3.init() | |
voices = engineio.getProperty('voices') | |
engineio.setProperty('rate', 130) # Aquí puedes seleccionar la velocidad de la voz | |
engineio.setProperty('voice',voices[0].id) | |
def speak(text): | |
engineio.say(text) | |
engineio.runAndWait() | |
speak("What do you want me to say?") | |
while(1): | |
phrase = input("--> ") | |
if (phrase == "exit"): | |
exit(0) | |
speak(phrase) | |
print(voices) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment