Last active
September 23, 2020 12:32
-
-
Save zakirangwala/7ca3f8a771058ede2c95e3f0b454e66d to your computer and use it in GitHub Desktop.
Tutorial code : Speak Function using the pyttsx3 package
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
import pyttsx3 | |
# Initialize Text to Speech | |
engine = pyttsx3.init('sapi5') | |
voices = engine.getProperty('voices') | |
engine.setProperty('voice', voices[1].id) | |
# Speak Function | |
def speak(audio): | |
engine.say(audio) | |
engine.runAndWait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment