如何在 Ubuntu 20.04 中使用 Google 文字转语音 (python)?

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,我正在从终端播放歌曲。我也尝试从终端播放 hello.mp3(来自 gtts 输出)。当我从终端 运行 时它在说 hello world 但当我在 Pycharm 中尝试 运行 时它显示错误。请帮助我!!

试试这个,

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

希望这能解决您的问题。