Sending and receiving audio to rhasspy in python

Hi, im attempting to use rhasspy to be integrated into a chat app, is there a way to send audio packets to and from rhasspy to my code? I see there is a mttq system for this but im struggling to find much info about it, are there any examples of this?

I basically need to make a program to relay all the audio from my chat app to and from rhasspy.

Sorry if i missed an already existing example, i could only find examples of intents, not anything similar to what i wanted to achieve.

https://rhasspy.readthedocs.io/en/latest/audio-input/

Although the project is deprecated, the code of hermes-audio-server is easy enough to follow in my opinion, and it does something similar to what you’re asking. Have a look at the AudioRecorder class to send audio frames to Rhasspy and the AudioPlayer class to receive audio frames from Rhasspy.

Although the project is deprecated?

Yes, I created hermes-audio-server before Rhasspy was modularized. When this functionality became available in rhasspy-speakers-cli-hermes and rhasspy-microphone-cli-hermes, I archived the repository. But as far as I know, it still works. And it can still be used for didactic purposes :slight_smile:

Why not just dump audio to stdout and setup rhasspy-microphone-cli-hermes ?

OP asked for a way for “Sending and receiving audio to rhasspy in python”. Hermes-audio-server code shows how to do this in Python.

Of course you can also just use rhasspy-speakers-cli-hermes and rhasspy-microphone-cli-hermes as CLI commands, but that doesn’t seem to be what OP is asking.

Let’s wait for @Zomatree’s answer, because the question lacks some detail :slight_smile:

the AudioRecorder and AudioPlayer from hermes-audio-server does seem to be what im looking for, i can simply replace the pyaudio stuff in my own code with the data coming in and out of my chat app. Thankyou for sharing this with me.