How to make Python speak

前端 未结 13 1208
时光说笑
时光说笑 2020-11-30 20:34

How could I make Python say some text?

I could use Festival with subprocess but I won\'t be able to control it (or maybe in interactive mode, but it won\'t be clean)

13条回答
  •  醉酒成梦
    2020-11-30 20:39

    If you are using python 3 and windows 10, the best solution that I found to be working is from Giovanni Gianni. This played for me in the male voice:

    import win32com.client as wincl
    speak = wincl.Dispatch("SAPI.SpVoice")
    speak.Speak("This is the pc voice speaking")
    

    I also found this video on youtube so if you really want to, you can get someone you know and make your own DIY tts voice.

提交回复
热议问题