文字转语音
我一直在尝试在 windows 和 Linux 环境中运行 pyttsx...
Linux 环境:
import pyttsx
engine = pyttsx.init()
python 在执行完第一行后就挂了。 我已通过在交互式 shell 提示符下运行这两行来验证上述声明。
windows环境:
import pyttsx
engine = pyttsx.init()
engine.say('Sally sells seashells by the seashore.')
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()
完美运行,并在安装后提供所需的输出 pyttsx 1.0 win32.exe ( from here ) 和 pywin 用于我的 windows ( from here )
所以实际上在 Linux 版本中我实际上缺乏什么???
语音转文本和语音再殖民
那么,pyttsx 可以完成这两项任务吗?如果没有,请推荐一些高效的库..
最佳答案
在 Windows 中,pyttsx 使用 sapi5 驱动程序。
在 Linux 中,pyttsx 使用 espeak 驱动程序。
您的 Linux 系统上安装了什么版本的 espeak?
espeak 和 pulseaudio 不能一起玩。
如果您的系统启用了 pulseaudio,请尝试禁用它,如果这不能防止挂起,请尝试降级或升级您的 espeak 版本,因为这已经解决了其他用户问题(崩溃而不是挂起)。
pyttsx 只做文字转语音。
替代解决方案包括
- Festival语音合成
- Julius STTT
- CMU Sphinx STTT
关于text-to-speech - Linux > Python > TTS、STT 和语音识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6383918/