python - Plyer TTS 无法在 Windows 上运行

标签 python text-to-speech

我无法让 plyer.tts 在 Windows 上运行。

已安装:

plyer 1.3.0

Python 3.6.5

示例:

>>> from plyer import tts
>>> tts.speak("Hello world!")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\plyer\facades\tts.py", line 30, in speak
    self._speak(message=message)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\plyer\facades\tts.py", line 35, in _speak
    raise NotImplementedError()
NotImplementedError

文档指出 tts 可在 Windows 上运行,我记得过去曾在另一台 PC 上运行过它。

可能是什么问题?

最佳答案

我对 NotImplementedError() 也有同样的问题。这意味着机器上找不到它正在寻找的文本转语音引擎/软件。虽然 plyer 在 Mac OS X 上使用 native tts 为我工作,但在 Windows 上你必须下载 tts 软件,因为我猜 plyer 不再设置为查找 native 软件,或者它的名称与以前不同,如果你说它在过去有效。

通过从 http://espeak.sourceforge.net 下载 espeak 来修复它。安装它并将 espeak.exe 文件移动到 python 可以找到的地方。对我来说,最简单的事情是将其移动到我尝试运行的脚本的顶级文件夹中。

关于python - Plyer TTS 无法在 Windows 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49870351/

相关文章:

javascript - 无法使用使用execute_script Selenium的javascript点击按钮

Python 如何制作 myDcitionary ['key1' ] ['key2' ]=list()

java - 文本转语音 (TTS) 延迟 3 秒朗读文本

swift - 如何快速暂停和恢复 AVSpeechSynthesizer/AVSpeechUtterance?

api - 使用 Chrome TTS 的 SSML

python - 在哪里找到python-2.6.0-8.9.28的xml.dom python包,我有一个Linux版本的suse/x86_64版本

python - 求一个月内n个最大的平均值,但日期必须是唯一的(Pandas)

python - 共享 txpostgres 连接池

ios - iPhone 上的德语文本转语音(Flite/Festival 语音?其他选项?)

android - 开车时将通知转为文字转语音