1import pyttsx3
2engine = pyttsx3.init()
3engine.say("")
4engine.runAndWait()
1 mshta vbscript:Execute("CreateObject(""SAPI.SpVoice"").Speak(""Hello"")(window.close)")
2
1import pyttsx3
2
3engine = pyttsx3.init('sapi5')
4voices = engine.getProperty('voices')
5# you can use print(voices) to see how many voices you have installed
6# print(voices[0].id)
7# print(voices[1].id)
8# print(voices[2].id)
9print(voices)
10engine.setProperty('voices', voices[0].id)
11
12def speak(audio):
13 print(audio)
14 engine.say(audio)
15 engine.runAndWait()
16
17speak('Hello')
18
19# prints hello and says it