Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LookupError: Speech is unintelligible #695

Open
Abonia1 opened this issue Jun 6, 2023 · 0 comments
Open

LookupError: Speech is unintelligible #695

Abonia1 opened this issue Jun 6, 2023 · 0 comments

Comments

@Abonia1
Copy link

Abonia1 commented Jun 6, 2023


import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
    r.adjust_for_ambient_noise(source, duration = 5)
    print("listening...")
    # read the audio data from the default microphone
    audio_data = r.record(source, duration=5)
    print("Recognizing...")
    # convert speech to text
    text = r.recognize(audio_data)
    print(text)

LookupError Traceback (most recent call last)
in
8 print("Recognizing...")
9 # convert speech to text
---> 10 text = r.recognize(audio_data)
11 print(text)

~/opt/anaconda3/lib/python3.8/site-packages/speech_recognition/init.py in recognize(self, audio_data, show_all)
337 # make sure we have a list of transcriptions
338 if "alternative" not in actual_result:
--> 339 raise LookupError("Speech is unintelligible")
340
341 # return the best guess unless told to do otherwise

LookupError: Speech is unintelligible

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant