在使用python做文字转语音时,安装pyttsx3报以上错误
原因是安装pyttsx3前要安装一个语音环境:“espeak”
安装命令:
sudo apt-get update && sudo apt-get install espeak
pip installpyttsx3
源码如下:
import pyttsx3
engine = pyttsx3.init()
engine.say('Sally sells seashells by the seashore.')
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()