Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Created December 14, 2020 09:18
Show Gist options
  • Save Abhayparashar31/aedc88b42d469ef2195bbf308be4e59a to your computer and use it in GitHub Desktop.
Save Abhayparashar31/aedc88b42d469ef2195bbf308be4e59a to your computer and use it in GitHub Desktop.
import pyttsx3
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
## speak("Don't Buy Alexa! Build Your Own Using Python") ## uncomment this to test the function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment