Stream I2S audio stream over bluethooth

Hi all,

I was planning to make a project where I have an I2S audio stream from a simple microphone, something like this.
I found this library for the ESP32 which seems to be quite good for my goal. My only problem is how I interface the I2S busses with the Bluetooth transmission. I can use something like i2s_read() to read the incoming audio stream, but then what I can do? I can make a vector where I save the audio and then send it to the Bluetooth speaker, but I don't know every how much time I have to interrupt the saving of the audio in the array to transmit it. Is there a way to achieve a sort of continuous stream of the upcoming audio without having to store it and then transmit it?
Thanks!

The examples for that library only show sending data from in-memory samples.
The problem with trying to interface I2S to that library is who's in charge? The library wants to be in charge, pulling data from a callback to send OTA.
However the I2S bus clock has to be in charge of the sample rate, it needs to drive the timing. Unless you can guarantee the exact same frequency for I2S sample clock and the
BT sample rate for that library, you'll have mismatch and glitches.

This is probably not a simple project - you'd need to figure out how the library works, and
details of the timing for I2S on the particular hardware.

You could just try it, assuming the rates are the same and have the callback pass the latest
completed I2S buffer each time.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.