【发布时间】:2019-04-29 07:54:39
【问题描述】:
我正在玩谷歌语音库如下:
from google_speech import Speech
# say "Hello World"
text = "Hello World"
lang = "en"
speech = Speech(text, lang)
speech.play()
收到此错误:
RuntimeError
Traceback (most recent call last)
<ipython-input-2-4daa3294f636> in <module>()
----> 1 from google_speech import Speech
2
3 # say "Hello World"
4 text = "Hello World"
5 lang = "en"
D:\soft\Ins\anac\lib\site-packages\google_speech\__init__.py in <module>()
321
322 # check deps
--> 323 bin_dep.check_bin_dependency(("sox",))
324
325
D:\soft\Ins\anac\lib\site-packages\google_speech\bin_dep.py in check_bin_dependency(bins)
5 for bin in bins:
6 if shutil.which(bin) is None:
----> 7 raise RuntimeError("Binary '%s' could not be found" % (bin))
RuntimeError: Binary 'sox' could not be found
我在 Windows 上工作,我做了所有说明:
如果您还没有,请为 Python 3 安装 pip
安装谷歌语音:pip3 install google_speech
安装 SoX,支持 MP3。在 Ubuntu 和其他 Debian 衍生产品上:sudo apt-get install sox libsox-fmt-mp3。 Windows 用户可以在 SoX 网站上下载二进制文件,安装后还需要将 libmad DLL 复制到安装 SoX 的目录中,并将该目录添加到 PATH 环境变量中。
【问题讨论】:
-
重置解决了问题!
标签: python windows speech-recognition sox