I want to connect an I2S audio source (48kHz, 24 Bit, Mono) to the Seed, and I already understood that I have to configure SAI2 to be I2S master it.
But I can not find any examples out there how to do this. The STM32 doc is really complex. What is the value of the master clock on the Seed? Do I need MCLK for a MEMS microphone or not? (INMP441).
And how do I set this I2S as the audio source for the AudioCallback() handler?
I could use DaisyDuino or simple Makefile.
A simple “loop station” hello world from line-in to audio out was so easy to program, but I get stuck getting any microphone input to the seed. It’s a pitty that there is no mic level input for dynamic mic.
I read the thread
But I can’t find any customer source for those max 4061/4062.
Nobody seems to connect any kind of mic to Daisy Seed, strange.
Any help is welcome, even the good old RTFM with the right links (but please not the full HAL of STM32).
Sorry for the major hold up! Here’s the code for adding an external audio codec. Since your device is a microphone and doesn’t use the transmit side, I’ve commented that out.
Your audio callback should have two new samples for the mic in, so it’ll be:
in[0][i] // on board codec L in, as usual
in[1][i] // on board codec R in, as usual
in[2][i] // mic L in. (I looked at the datasheet, and the mic claims to have L and R, which is a bit weird!)
in[3][i] // mic R in
out[0][i] // on board codec L out, as usual
out[1][i] // on board codec R out, as usual
Let me know how that works or if you have any other questions!
Also looking to hook up an external I2S source. Did this example work? I tried running it to an ESP32 I2S Master streaming A2DP bluetooth to the I2S port. No response from the Daisy… I need a master clock?
Connection: