Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (280 points)

In my system, I've already installed pyaudio, but here the problem is with microphone functions

import speech_recognition as sr

r = sr.Recognizer()

mic = sr.Microphone()

Here, The problem is with the third line of the above code mic=sr.Microphone()  . Ultimately, the terminal will give us this message

Please build and install the PortAudio Python bindings first.

Now, when I install "pip install PortAudio", the terminal says

Could not find a version that satisfies the requirement PortAudio (from versions: )No matching distribution found for PortAudio

So, I have pyaudio but I don't have PortAudio.Can anyone help me with this doubt?

1 Answer

0 votes
by (26.4k points)

Type the following code and uninstall your pyAudio

pip uninstall pyAudio

With your python, you just need to get pyAudio compatibility, in my case with 32 bit I have 3.7, but my problem arises when I try to install 64bit pyAudio on my 32bit python.

After uninstalling, Click on this link 

Then I downloaded 


To install it, Go to the directory in cmd and type

pip install PyAudio-0.2.11-cp37-cp37m-win32.whl

and This will solve your problem.  

For more details about Python, refer to this tutorial on the Python training course

Browse Categories