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

Please slove the issue anyone #30

Closed
AnkitkrGuptaa opened this issue Dec 22, 2020 · 5 comments
Closed

Please slove the issue anyone #30

AnkitkrGuptaa opened this issue Dec 22, 2020 · 5 comments

Comments

@AnkitkrGuptaa
Copy link

`
1608652675590

@lbracko
Copy link

lbracko commented Dec 22, 2020

I get the same error on MacBook!

@Stroper111
Copy link

Stroper111 commented Dec 22, 2020

The problem is in the bare except statement.

def take_command():
    try:
        with sr.Microphone() as source:
            print('listening...')
            voice = listener.listen(source)
            command = listener.recognize_google(voice)
            command = command.lower()
            if 'alexa' in command:
                command = command.replace('alexa', '')
                print(command)
    except:
        pass
    return command

It is hiding any error that you are getting, and instead it goes directly to the return command part.
This command is then not yet available.

You can either display the error yourself:

except Exception as e:
     print(e)
return command

or instead of the pass, return a command that indicates that it went wrong.

@whoschisa
Copy link

bro its still showing wrong

@whoschisa
Copy link

and there are other errors also
that too a lot

@ashraf-minhaj
Copy link
Contributor

See issue #5

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

5 participants