Last active
January 6, 2024 19:53
-
-
Save se7enack/930a61392cc5d6fb4465dc14b4d42e07 to your computer and use it in GitHub Desktop.
An example of pyttsx3 Text to Speech
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
#!/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