Snowboy-CustomMaker

iya!

Like some of you ever know, I had problems with getting custom wakeword with snowboy working fine. I mean, good detection, and no false positive!

I finally get it running fine, even better than snips one actually ( :no_mouth: ) after doing home-work and writing a few tools to achieve this.

I get some time to clean all this and share all tips and tools I used for that, so here it is :

Let me know if the doc is understandle, if downloading and running scripts goes fine, etc.

Also, english isn’t my mother language, so if some part need some rewrite, don’t be shy I won’t feel ashamed (well, maybe, but I will do correction :rofl:)

:beers:

5 Likes

Good work! I will try it and see how far I get.
I just need to get up with a good wake word :smiley:

Good job Kiboost, I will try it also.
Currently I used my own snowboy wakeword (nestor) its not so bad but sometimes with a lot of false postive.

Thanks for your work !

Hi @KiboOst,

I created a buster image sdcard and follow your Howto.
But I got this message when I tried python3 snowboyRecord.py --wakeword nestor

“OSError: libasound.so: cannot open shared object file: No such file or directory”

Hi,

I see why it does that, seems you don’t have libasound which was installed by seed driver on my pi

Can you redownload snowboyRecord.py and give it a try ?

Well done.
The 3 .wav are well created but I have these lines below (I don’t know if its important or not)
Fyi I use a Jabra and I have created the $HOME/.asoundrc to use it.

recording

finished recording
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.front.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front
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 confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround40.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround51.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.surround71.0:CARD=0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition ‘cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
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
Expression ‘alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )’ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 924
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

At next step (python3 snowboyTrain.py --token 
 ) I have this error :

Building model nestor with options M : 3
Traceback (most recent call last):
File “snowboyTrain.py”, line 67, in
generateModel(args)
File “snowboyTrain.py”, line 18, in generateModel
wavSample1 = get_wave(args.wakeword+"/0.wav").decode()
File “snowboyTrain.py”, line 13, in get_wave
file = infile.read()
File “/usr/lib/python3.7/codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x80 in position 24: invalid start byte

If your wav file are good when you play them, all is good then. Never saw this the correction I did was because it can’t load your Alda lib to prevent alsa warnings to show but these are not warning but error. Seems your alsa config are problematic.

But if you have three good wav files, cut the leading and trailing noise in audacity and get your pmdl to test.

Seems your wav files are corrupted then :thinking:
Did you tried to play them ? Can you listen your voice ? Did you re export them from audacity ?

Yes OK with aplay and its me :laughing:
I make two wakeword nestor and pepper. pepper reexported from audacity not nestor.
The 2 wakewords generate this error.

I think I’ll reinstall all in my original rhasspy sdcard to see is there is a difference


EDIT : same issue with sdcard rhasspy.

Could you send me one of these wav file in mp ?

upload of wav impossible with “messages” when I clic on your name (just pictures authorized) :confounded:

Rename it to .jpg ? Or .zip ?

I tried, but the upload try to determine the size and he can’t.
EDIT : ==> Je passe par community Jeedom + renommé en .txt

EDIT 2 : Take the time ! I’m not in the hurry :wave:

Ok, had same error, can you redownload snowboyTrain.py and retry ?

Result :

Building model nestor with options fr | M | 3
Request failed.
{“voice_samples”:[{“recorder_age_group”:["“False” is not a valid choice."]},{“recorder_age_group”:["“False” is not a valid choice."]},{“recorder_age_group”:["“False” is not a valid choice."]}]}

3 isn’t valid for --age, try 30
or python3 snowboyTrain.py -h

Great !
:+1: :+1: :+1:

Ahah, now test your wakeword :rofl:

I’m looking for a way to automatically cut leading and trailing noise to avoid having to do it manually in audacity. If there is some pyaudio guru there :woozy_face:

1 Like

Yes. thks.

Audacity is not so difficult :wink: