I’m currently trying to use the Porcupine wakeword detection engine together with the Snips platform. I want both of them to run on the same Raspberry Pi, using the same microphone as audio input (ReSpeaker Mic Array v2). However, the audio server component of Snips seems to block the microphone input stream, such that Porcupine cannot access it simultaneously.

Is that an issue that can be solved with a proper alsa configuration (e.g. using dsnoop)? Or is the problem a deeper one?

Thank you for your answer, that looks pretty awesome! I can probably adapt that for my purposes.

I’m not really familiar with processing audio signals and how the Snips audio server works in detail, so just to be sure that I understand everything correctly:

That looks like the audio input signal of a site is broadcasted via MQTT by the Snips audio server, is that correct? And now you feed each audio frame that you receive into Porcupine. Is Porcupine only evaluating this single frame or does it also consider past frames?

That looks like the audio input signal of a site is broadcasted via MQTT by the Snips audio server, is that correct?

Yes correct

That code only works for one site device… it’s old code
I created a threaded class of porcupine objects for each satellite mqtt stream and pass audio samples to each object depending on the mqtt that arrives

Ah okay, now it makes perfect sense. In my case one site is enough anyways. Thank you for sharing!

why is this wake word engine better than the snips build in?

I think it depends on what you are looking for. Porcupine allows you to choose an (almost) arbitrary global wake word and the recognition rate is great. Also, you don’t have to do any recording.

I didn’t want to use one of the built-in global wake-words of the Snips platform because they are not suitable for my use case. I also tried to record a custom wake word, but that didn’t work too well. I also had a lot of trouble with false positives with both global and custom wake words. Porcupine worked much better in that regard.

They improved the Hey Snips wake word in the new release, so maybe that’s interesting for you. I haven’t evaluated it yet though.

In general this works really well and is exactly what I was looking for. However, sometimes it mysteriously stops working, even though there is no apparent reason for it. Frames are still being received from the audio server. Any ideas?

There was a discussion a little while ago about satellite snips devices stopping and turned out to be WiFi disconnecting causing users to think snips stops… just thinking out loud, and thought this might be something similar