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

Exception in AudioProducer blocks speech module #2779

@dalgwen

Description

@dalgwen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions