Git Product home page Git Product logo

Comments (10)

Prince2347X avatar Prince2347X commented on September 5, 2024 8

When you're calling the function at the end, use a try-except block to handle the exceptions. See this ↙

while True:
    try:
        run_alexa()
    except UnboundLocalError:
        print("No command detected! Alexa has stopped working ")
        break

Hope this'll work!

from romantic-alexa.

Jinoy-Varghese avatar Jinoy-Varghese commented on September 5, 2024 1

Try this (in admin mode command prompt):

pip install pipwin
pipwin install pyaudio

Thanks bro it is working properly now

from romantic-alexa.

eranga-mohotty avatar eranga-mohotty commented on September 5, 2024

pip install pyaudio
solved this problem for me. speech_recognition was throwing an error without it

from romantic-alexa.

vampirepapi avatar vampirepapi commented on September 5, 2024

Try this (in admin mode command prompt):

pip install pipwin
pipwin install pyaudio

from romantic-alexa.

adityayadaviit avatar adityayadaviit commented on September 5, 2024

When you're calling the function at the end, use a try-except block to handle the exceptions. See this ↙

while True:
    try:
        run_alexa()
    except UnboundLocalError:
        print("No command detected! Alexa has stopped working ")
        break

Hope this'll work!

not working
new error :
IndentationError: expected an indented block

from romantic-alexa.

Prince2347X avatar Prince2347X commented on September 5, 2024

not working
new error :
IndentationError: expected an indented block

Check the indentation of your code properly!..🤷‍♂️

from romantic-alexa.

adityayadaviit avatar adityayadaviit commented on September 5, 2024

from romantic-alexa.

mastermindharsh avatar mastermindharsh commented on September 5, 2024

Try this (in admin mode command prompt):

pip install pipwin
pipwin install pyaudio

worked for me

from romantic-alexa.

jmherrera11 avatar jmherrera11 commented on September 5, 2024

I did this and just it extends a little more before error

while True:
try:
run_alexa()
except UnboundLocalError:
print("No command detected! Alexa has stopped working ")
run_alexa()

I think is needed to handle the UnboundLocalError: local variable 'command' referenced before assignment

from romantic-alexa.

jmherrera11 avatar jmherrera11 commented on September 5, 2024

This a Lousy solution but at least it will continue listening:

while True:
try:
run_alexa()
except UnboundLocalError:
print("No command detected! Alexa has stopped working ")
command = "."

from romantic-alexa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.