Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Exception in AudioProducer blocks speech module #2779

Closed
dalgwen opened this issue Dec 15, 2020 · 2 comments
Closed

Exception in AudioProducer blocks speech module #2779

dalgwen opened this issue Dec 15, 2020 · 2 comments
Labels

Comments

@dalgwen
Copy link

dalgwen commented Dec 15, 2020

Describe the bug
An exception in AudioProducer could happen, by a flaw in the code, in some rare occurence.
The speech module then hangs (no more voice recognition, as the mic managment is broken)

To Reproduce
Don't know exactly.
I was playing with some dev around custom TTS
But it's not very important, as the fix seems to be straightforward

Expected behavior
This exception should not happen.
I think the variable 'audio_data' should be declared outside the loop.

Log files
2020-12-12 17:46:26.995 | ERROR | 2194 | mycroft.client.speech.listener:run:108 | Exception in AudioProducer Traceback (most recent call last): File "/home/pi/mycroft-core/mycroft/client/speech/listener.py", line 84, in run self.stream_handler) File "/home/pi/mycroft-core/mycroft/client/speech/mic.py", line 711, in listen ww_data = self._wait_until_wake_word(source, sec_per_buffer) File "/home/pi/mycroft-core/mycroft/client/speech/mic.py", line 658, in _wait_until_wake_word return WakeWordData(audio_data, said_wake_word, UnboundLocalError: local variable 'audio_data' referenced before assignment

Environment (please complete the following information):

  • Device type: Raspberry Pi
  • OS: raspbian
  • Mycroft-core version: 20.08

Additional context
I will provide a quick PR.

@dalgwen dalgwen added the bug label Dec 15, 2020
@dalgwen dalgwen changed the title Exception in AudioProducer blocks speeh module Exception in AudioProducer blocks speech module Dec 15, 2020
@forslund
Copy link
Collaborator

Nice catch, should definitely be addressed and you're PR looks nice and simple. Thanks for raising and fixing this

@forslund
Copy link
Collaborator

forslund commented Dec 30, 2020

Should be resolved by #2780. Closing

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

No branches or pull requests

2 participants