import winsound
import win32com.client
import time
speak_out = win32com.client.Dispatch("SAPI.SPVOICE")
def speak(str):
print(str)
speak_out.Speak(str)
winsound.PlaySound(str, winsound.SND_ASYNC)
Time = 5
while(Time):
speak("我叫LEO")
speak("我最帅")
speak("毋庸置疑")
time.sleep(1)
Time = Time-1
Python implements simple text and voice output broadcast
Guess you like
Origin blog.csdn.net/zouchengzhi1021/article/details/113926129
Recommended
Ranking