Voice output in realtime

I have a technical question for you and hope that someone could help me.

I am looking for a possibility to pass through the noise that the microphones of a Matrix Creator board are listening, directly to the audiojack of my Raspberry. Similar like an megaphone or something.

The only solution I found was to record something and playback it after again, but noting in real-time. I hope that anybody can help me.

Will not happen, input and output both use the same bus to read/write to the SPI.
Simultaniously will crash your app

Hi @Snipico,

Welcome to our community!

The audio driver was written for concurrent reading/writing so what you are suggesting should be possible!

I have never tried this myself though. I found this thread that you could modify to test out. I will do the same & get back to you with my findings!

Best,
Samreen

1 Like

Hi Samreen,
thanks for your help. I’m trying my luck. I am excited for your findings.

Best regards
Snipico

Hello Samreen,
I found a function to Record and Play in realtime (Short Delay) but the output is only a Noise. Do you have an idear so solve it?

Process audio data:

If you want to listen to what is currently being recorded via the microphone for tests, you can transfer the sound from arecord directly to aplay via pipe. However, there is a slight delay between recording and playback:

arecord -t wav -D plughw:0,0 | aplay -D plughw:0,0

Hi @Snipico,

Wow, I didn’t realize it was as simple as piping arecord to aplay, that makes sense!

I just tested with a version of your command that worked for me and I was able to hear myself speaking with a delay and some recursive nature of course.

I used the following mod on your command.

arecord -f S16_LE -t wav -D plughw:2,0 | aplay -D plughw:0,0

The -f S16_LE part means Signed 16 bit Little Endian. That is the format the MATRIX mics accept.

The other part that may be contributing to noise for you is your microphone hardware device number. Generally, on our devices, this is plughw:2,0 (card 2, device 0). You can quickly check what it is for you by typing arecord -l in your terminal. It should show up like below. Then you can adjust the arecord plughw number accordingly.

Hope this helps!

Best,
Samreen

Hi Samreen,

Sorry for the late reply. I hadn’t considered that. Thank you for your help. This is exactly what I wanted.

Best regards

1 Like