Skip to content

Instantly share code, notes, and snippets.

@EnkrateiaLucca
Created September 27, 2020 12:35
Show Gist options
  • Save EnkrateiaLucca/5b7ac212d4354564c38841e37b317e19 to your computer and use it in GitHub Desktop.
Save EnkrateiaLucca/5b7ac212d4354564c38841e37b317e19 to your computer and use it in GitHub Desktop.
Speaking a list of sentences
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