-
-
Save lcsouzamenezes/a26f024400fca62a1d6a72da1eb11bc8 to your computer and use it in GitHub Desktop.
Usando a biblioteca pyttsx3 para text-to-speech no Python
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
# Instalar o pyttsx3 com o comando abaixo: | |
# pip install pyttsx3 | |
import pyttsx3 | |
# Iniciando a biblioteca na variável engine | |
engine = pyttsx3.init() | |
# Função pronta para uso | |
def speak(speech): | |
engine.say(speech) | |
engine.runAndWait() | |
# Só chamar a função speak() | |
speak("Isto é um Quadrado!") | |
speak("Isto é um Triângulo!") | |
speak("Isto é uma Estrela!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment