Search code examples
pycharmpython-3.8google-text-to-speechubuntu-20.04gtts

How to use Google Text to Speech (python) in Ubuntu 20.04?


Here is the screenshot of the errors which I am getting. Please help me! I have also installed mpg321 in my Ubuntu 20.04. It is working fine if I play music from terminal. Here, I am playing a song from terminal. I've tried to play hello.mp3 also(from gtts output) from terminal. It's saying hello world when I run from terminal but when I try run in Pycharm it shows errors. Please help me!!


Solution

  • Try this,

    #pip install playsound
    from playsound import playsound
    playsound("fileName.mp3")
    

    Hope this resolved your issue.