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