[CODE SAMPLE] Respeaker Core V2 streaming over WebSockets to custom ASR

Initial Problem

Echo Dot and Google Home speakers can’t work offline and don’t support my native language. That’s why I started looking for good hardware and software to meet my requirements.

Respeaker Core V2

Respeaker board seemed exactly what I was looking for. But unfortunately, most of the existing code samples are focused on useless AVS integration. Why useless? IMHO, it absolutely makes no sense to buy a $99 device to create another Alexa (which costs 5 times cheaper on Black Friday).

Moreover, all the respeaker repos are abandoned. I spent several months poking around these and similar repositories trying to figure out how to stream pre-processed audio chunks to the custom ASR engine w/o overcomplicated IPC, but w/ all the Respeaker features like DSP and LED control.

And here’s another disappointment: DSP samples are in C. Pixel Ring is in Python. Respeakerd is a mix of both + AVS wrapper in the middle. Official Python lib doesn’t use DSP at all. It’s a hell of dependencies that require good support. Ok, any support. But there’s none, unfortunately. So what’s next?

Respeaker WebSockets

For those who really interested in revealing Reaspeaker potential, here’s an initial implementation of respeaker-websockets. It’s based on respeakerd, librespeaker samples and snips-skill-respeaker.

As Respeaker board doesn’t have enough resouces to perform any sort of speech recognition, there was created a WebSocket transport for pre-processed (DSP algorithms) audio streaming to custom ASR server which supports different languages. There’s no IPC used for the LED control or any other useless cross-language communication. Thanks to Snips developers who shared a sample code of how to control a Pixel Ring from C-code.

Note that I’m not a C++ dev, so would be greatly appreciated any suggestions or improvements.