Created
September 27, 2020 12:35
-
-
Save EnkrateiaLucca/5b7ac212d4354564c38841e37b317e19 to your computer and use it in GitHub Desktop.
Speaking a list of sentences
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
def say_tasks(tasks,name): | |
speaker = pyttsx3.init() # Initializing the speaker | |
voices = speaker.getProperty("voices") # Getting the available voices | |
speaker.setProperty("voice",voices[1].id) # Setting a nicer voice than default | |
speaker.say("Good Morning Lucas, your tasks for today are:") # Introducing the task-list | |
speaker.runAndWait() | |
for task in tasks: # Speaking each task sequentially from a list | |
speaker.say(task) | |
speaker.runAndWait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment