Closed ghost closed 6 years ago
mic.listen()
returns a generator which can be used only once.
In your case, you can convert the generator to a audio string first.
data = mic.listen()
data = b''.join(data)
text = bing.recognize(data)
alexa.recognize(data)
did not work.. bing could recognise the text, but alexa voice service just gets stuck
INFO:mic:Detected alexa DEBUG:root:wakeup INFO:mic:Start listening INFO:mic:Stop listening DEBUG:requests.packages.urllib3.connectionpool:"POST /recognize/query?sblahblah…. HTTP/1.1" 200 None DEBUG:root:Recognized what is the time INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): api.amazon.com DEBUG:requests.packages.urllib3.connectionpool:"POST /auth/o2/token HTTP/1.1" 200 977 INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): access-alexa-na.amazon.com DEBUG:root:Start sending speech to Alexa Voice Service
at this point 3 green LEDs just track around and alexa never talks, and nothing moves past this point
Updated https://github.com/respeaker/Alexa, it should work now
I am trying to work with the Alexa example code and keep running into trouble with working from the data the mic creates (I have removed some code to make is more compact here)
`if mic.wakeup(keyword='alexa'): logging.debug('wakeup')
seems that bing uses the (data) and when alexa goes to use the (data) it does not work and gives some error as nothing to work with
is there a way to wait for the mic.listen to complete before moving along in code??
I want to use bing to give me what was said, then pass the data to alexa to do its thing
i even tried using my own function to save the data to file
data = mic.listen() savewav(data)
but this gives me some error about there being no length and the wave function crashes.