我通过在pyaudio
中进行pip install pyaudio
安装了cmd
模块,但是一旦运行程序,它就无法正常工作。
pip install pyaudio
pip install --upgrade setuptool
import speech_recognition as sr #In the speech recognition python shell
finds an error
r = sr.Recognizer()
with sr.Microphone() as source:
print("Speak Anything :")
audio = r.listen(source)
try:
text = r.recognize_google(audio)
print("You said : {}".format(text))
except:
print("Sorry could not recognize what you said")
我正在尝试使用python制作语音识别程序。我在网上找到了大部分代码,但做了一些修改。您能指导我如何安装PyAudio或解决我的问题吗?