How to make Python speak

前端 未结 13 1190
时光说笑
时光说笑 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 21:04

    The python-espeak package is available in Debian, Ubuntu, Redhat, and other Linux distributions. It has recent updates, and works fine.

    from espeak import espeak
    espeak.synth("Hello world.")
    

    Jonathan Leaders notes that it also works on Windows, and you can install the mbrola voices as well. See the espeak website at http://espeak.sourceforge.net

    0 讨论(0)
提交回复
热议问题