LeonardSEO / MMM-VoiceCompanion

A voice-activated assistant module for MagicMirror² using OpenAI's Whisper for speech recognition and GPT for natural language processing. This module allows users to interact with their MagicMirror using voice commands, enhancing the smart mirror experience with AI-powered conversations and information retrieval.
MIT License
5 stars 2 forks source link

Error in listenForWakeWord: PvRecorderStatusIOError: PvRecorder failed to read audio data frame. #2

Closed gazambuja closed 1 month ago

gazambuja commented 2 months ago

I followed the instructions, and everything went well, but the wake word isn't working. Could it be a permissions issue? I'm on Linux, using my laptop to test.

[2024-09-01 07:42:24.437] [LOG]   MMM-VoiceCompanion helper received a socket notification: INIT 
[2024-09-01 07:42:24.438] [LOG]   Received configuration: 
[2024-09-01 07:42:24.438] [LOG]   Wake Word: ALEXA 
[2024-09-01 07:42:24.438] [LOG]   OpenAI Key received: Yes 
[2024-09-01 07:42:24.438] [LOG]   Porcupine Access Key received: Yes 
[2024-09-01 07:42:24.440] [LOG]   Setting up Porcupine with wake word: ALEXA and sensitivity: 0.7 
[2024-09-01 07:42:24.449] [LOG]   Available audio devices: [
  'Monitor of Built-in Audio Analog Stereo',
  'Built-in Audio Analog Stereo'
] 
[2024-09-01 07:42:24.557] [LOG]   MMM-VoiceCompanion: Porcupine and recorder setup complete 
[2024-09-01 07:42:25.675] [ERROR] Error in listenForWakeWord: PvRecorderStatusIOError: PvRecorder failed to read audio data frame.
    at pvRecorderStatusToException (/home/mirror/MagicMirror/modules/MMM-VoiceCompanion/node_modules/@picovoice/pvrecorder-node/dist/errors.js:45:20)
    at Timeout._onTimeout (/home/mirror/MagicMirror/modules/MMM-VoiceCompanion/node_modules/@picovoice/pvrecorder-node/dist/pv_recorder.js:107:49)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7) 

[2024-09-01 07:42:30.009] [LOG]   MMM-VoiceCompanion: Still listening for wake word... 
[2024-09-01 07:42:50.012] [LOG]   MMM-VoiceCompanion: Still listening for wake word... 
LeonardSEO commented 2 months ago

Thank you, @gazambuja, for reporting this issue. I appreciate the detailed information. I'll look into the PvRecorderStatusIOError and see if it's related to permissions or audio devices on Linux. Thanks for your help in improving the project!

LeonardSEO commented 1 month ago

Dear @gazambuja ,

I'm happy to inform you that we've fixed the PvRecorderStatusIOError you encountered. We've made several improvements to the module, including better error handling, improved audio device initialization, and adaptive noise detection. To get the fix:

Update your local copy of the module Check the README for new configuration options Restart your MagicMirror

If you have any questions or issues, please let me know. Your feedback is greatly appreciated!