librespeaker Snowboy1bDoaKwsNode and multiple models fails with sensitivities mismatch

So I have been playing with librespeaker getting it to work for snips with minimal external dependencies and I have noticed a problem (or at least something weird when I use it) with multiple Snowboy hotword models.



When I provide multiple models to the Snowboy1bDoaKwsNode::Create call and then provide matching multiple sensitivities I have to provide one extra sensitivity for it to work.



An example:

I provide the following for my hotword model string:
</s>Olga_Chris.pmdl,snowboy.umdl,computer.umdl,jarvis.umdl,alexa_02092017.umdl,OK_Google.pmdl<e>
and the following sensitivity string:
</s>0.4,0.4,0.4,0.4,0.4,0.4<e>
So 6 models and 6 sensitivities in total.



I get the following error when running:

Strangely its saying I have 1 extra universal hotword then I have provided. If I add an extra ,0.4 to my sensitivity string then it no longer gets unhappy.



I also see a strange hotwork activated index when I trigger the hotword. The index doesn’t seem to match up with what model I expect to be triggered.



Any insight or help is much appreciated.

Thanks.



chris.

Circling back to this my self with a solution.



After doing some more digging it looks as if its possible for snowboy universal models to actually contain multiple hotwords.

A quote from the snowboy-detect.h include file:
</s>// CAVEAT: a personal model only contain one hotword, but an universal model // may contain multiple hotwords. It is your responsibility to figure // out the index of the hotword. For example, if your model string is // "foo.pmdl,bar.umdl", where foo.pmdl contains hotword x, bar.umdl // has two hotwords y and z, the indices of different hotwords are as // follows: // x 1 // y 2 // z 3<e>

So after process of elimination it turns out that the jarvis.umdl model that I was including actually contained two hotwords (not that thats documented any where), and that was skewing the detected hotword index. It was also the cause of the error message saying I had not provided enough sensitivity values.



I think this issue can be considered solved. But I’ll leave this here so people can reference it hopefully if they run into the same thing.

One note I would add is that I think you guys (seeed) should add similar verb-age to the librespeaker documentation so that its a know thing and people don’t get tripped up on it when using multiple models (especially universal ones that may contain multiple hotwords).



chris.