1

I am trying to create an application which uses wakeword with snowboy and speech recognition using the speechRecognition library in Python.

When I start my scripts, when say I my wake-word - 'Python', it takes around 3 or 4 seconds to activate and play the sound - 'dong'. This also happens further when my script proceeds and tries to get the speech input from the user.

The main reason I can find is that PyAudio or maybe Alsa print out the following -

'ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device' ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device' ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave

This makes my script a lot slow although everything works fine. Is there a way to disable these messages and those from omxplayer as well?

If not, is there any way on linux to make my script fast and respond as soon as the wakeword is detected?

  • "Everything works fine" I think what you mean is that you get the desired result - eventually. However most of the output you show suggests misconfiguration (trying to open non-existent PCM cards) or flat out errors. it's quite possible that the delay is largely caused by the errors themselves rather than outputting the messages. – Charemer Jan 2 at 10:45
  • 1
    Is there a way to fix those errors? Like editing some config files? – Ashutosh Tiwari Jan 2 at 10:52
  • Not being familiar with snowboy or your Python library I couldn't tell you what to do to fix it. Check any configurations match your hardware. It may be necessary to edit the Python scripts as well - it's not possible to say without actually doing (or having done it) the exact same as you are. – Charemer Jan 2 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.