Error “Could not find PyAudio; check installation” on Windows

不想你离开。 提交于 2020-04-30 08:30:52

问题


I have simple code in python to recognise my voice and convert it in text. I am using speech recognition.

But I am getting error "Could not find PyAudio; check installation". How to fix?

Here is my code:

import speech_recognition as sr

r = sr.Recognizer()

with sr.Microphone() as source:
    print('Speak anything')
    audio = r.listen(source)

    try:
        global command
        command = r.recognize_google(audio)
        print('You said : {}'.format(text))
    except:
        print('Sorry,coud not recognize')

回答1:


Install pyaudio.

if you are using jupyter notebook on anaconda prompt then

conda install pyaudio

if you are using jupyter notebook using cmd then on jupyter cell,

import sys
!{sys.executable} -m pip install pyaudio

if you are running python file on cmd then,

pip3 install pyaudio #for python3


来源:https://stackoverflow.com/questions/55889543/error-could-not-find-pyaudio-check-installation-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!