I am creating a project that requires the SpeechRecognition library and I have it all installed and whatnot but everytime I run the program... the program doesn't transcribe what I am saying and it doesn't throw any errors either.
Here Is My Code
import speech_recognition as sr
r=sr.Recognizer()
print(sr.Microphone.list_microphone_names())
with sr.Microphone() as source:
r.adjust_for_ambient_noise(source,duration=1)
# r.energy_threshold()
print("say anything : ")
audio= r.listen(source)
try:
text = r.recognize_google(audio)
print(text)
except:
print("sorry, could not recognise")
Output
['Background Music', 'Background Music (UI Sounds)', 'MacBook Air Microphone', 'MacBook Air Speakers', 'Iriun Webcam Audio', 'EpocCam Microphone']
say anything :