Reputation: 183
I have tried all the possible ways from the community answers mentioned.But Still i am getting the same error...
import speech_recognition as sr
import pyaudio
import PortAudio
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 voice')
ERROR:Please build and install the PortAudio Python bindings first.An exception has occurred, use %tb to see the full traceback SystemExit:-1.
To solve the above issue I have tried to install pyaudio
through a GUI based app which went fine but when I tried to execute the program, I got to know I need to install a wheel module through the cmd where I used
pip install C:\Users\XXXX\Downloads\PyAudio-0.2.11-cp37-cp37m-win32.whl
then it gave the following error: > ERROR: PyAudio-0.2.11-cp37-cp37m-win32.whl is not a supported wheel on this platform.
How to resolve this?
Upvotes: 2
Views: 829
Reputation: 32
I also had a similar problem.
First change your code to this:
import speech_recognition as sr
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 voice')
i.e. remove import pyaudio
and import portaudi
o
then in the Command Prompt run:
pip install pipwin
And then:
pipwin install pyaudio
Upvotes: 0