You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
427 B
Python

import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
# engine.setProperty('voice', voices[3].id)
# engine.say("I will speak this text")
# engine.runAndWait()
# engine = pyttsx3.init()
# voices = engine.getProperty('voices')
# print(voices)
for voice in voices:
engine.setProperty('voice', voice.id)
print(voice)
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()