Skip to content

Instantly share code, notes, and snippets.

@se7enack
Last active January 6, 2024 19:53
Show Gist options
  • Save se7enack/930a61392cc5d6fb4465dc14b4d42e07 to your computer and use it in GitHub Desktop.
Save se7enack/930a61392cc5d6fb4465dc14b4d42e07 to your computer and use it in GitHub Desktop.
An example of pyttsx3 Text to Speech
#!/Users/user/miniconda3/bin/python3
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 150)
engine.setProperty('volume', 1.0)
people = {
"ukguy": 7,
"robot": 11,
"augal": 17,
"usgal": 33
}
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[people["augal"]].id)
engine.say("Put another shrimp on the barbie!")
engine.runAndWait()
engine.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment