Skip to content

Instantly share code, notes, and snippets.

@ryanbekabe
Created August 24, 2019 12:23
Show Gist options
  • Save ryanbekabe/9cc7916ae5667568ac3fa53b1febca8f to your computer and use it in GitHub Desktop.
Save ryanbekabe/9cc7916ae5667568ac3fa53b1febca8f to your computer and use it in GitHub Desktop.
Python Text to Speech
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