问题
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