I am running the following code in Python 2.7 with pyAudio installed.
import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source:
In addition to Tushar's answer, I suggest trying a nicer external USB microphone. PyAudio can have issues with a simple built-in laptop microphone.