【发布时间】:2022-01-06 16:08:45
【问题描述】:
我正在使用 Spyder 5.1.5/Anaconda (Python 3.8.10) 在 Windows 10 上按照this PythonCode page 中显示的示例进行语音识别。
我用conda install -c conda-forge 安装了SpeechRecognition 和pydub,当我运行以下脚本时:
with sr.AudioFile(filename) as source:
audio_data = r.record(source)
text = r.recognize_google(audio_data)
print(text)
或者更具体地说 (text = r.recognize_google(audio_data)),会显示此错误消息:
OSError: FLAC conversion utility not available - consider installing the FLAC command line application by running `apt-get install flac` or your operating system's equivalent
There's a similar question 但在没有apt-get install flac 或brew 的Windows 环境中找不到解决方案。
在this post 之后,我已经下载了flac.exe 文件并放在C:\Windows\System32 下。我可以在命令行上运行 flac,但是当我运行 python 脚本时会出现同样的错误。
有人知道如何解决这个问题吗?
【问题讨论】:
标签: python windows speech-recognition spyder flac