how to play mp3

前端 未结 12 1670
醉酒成梦
醉酒成梦 2021-02-09 09:39

my problem starts here:

pyttsx and gTTS module errors

gTTS works well, takes text from text file, but first creates mp3 file, then if I want listen, I must call

12条回答
  •  臣服心动
    2021-02-09 10:10

    If you are on windows then this should do the job,

    import winsound
    winsound.PlaySound('your_file.mp3',winsound.SND_FILENAME)
    

    Remember this package is only present in python for windows.

提交回复
热议问题