How to get audio out from a ESP32 c3 XIAO

Hello. How would i get audio out to a headphone jack from a seeed studio xiao? im building a link device that listens on a espnow channel and outputs a bpm metronome sound maybe through i2s? i want it to be as simple as possible and it doesnt have to be stereo. I want 3 buttons, ssd1306, xiao, and audio output. Please help, thanks.

Hi there,

and Welcome here…

Should be easy enough, You could do it two ways analog out or I2S , The ESP32C6 may be better but probably not by much… Post what code your working with and others will comment use the code tags above “</>” paste it in there :+1:
I’m also looking at some Stuff like this with the reSperaker Light to but the Xiao to DAC out to Headphones…
see it here…the purple one.


HTH
GL :slight_smile: PJ :v:

Hi PJ,

Could you say more about these two methods?

Analogue Audio: I don’t think the ESP32C3 has a DAC, so we’d be going directly from a GPIO pin with a PWM tone as I understand it. What kind of circuitry/components would follow that?

For I2S: I was thinking of using the methods of DronBotWorkshop. My question regarding this is: would it be possible to use a file from the flash memory instead of the SD card?

You can use an I2S DAC module like MAX98357A or PCM5102
Output mono audio to headphone jack (use a 1k resistor to mix both L/R if needed).This avoids PWM noise and gives clean audio.

1 Like

Hi there,

And welcome here…

So yes, the Drone Dude has it also working well as the same. I2S is the chosen method for fidelity and PWM if it’s just a basic sound out kinda thing. None have DAC’s worth the effort so the External Dac works well. Check out the reSpeaker as well, tricky but definitely a nice sounding product. The I2S has threads all over here for all MCU’s and even some micropython AFAIK. C3 is good enough but to play from internal flash I would use and S3 (psram) and more support.

HTH
GL :slight_smile: PJ :v:

Hit the search up top for more on I2S, Audio out of Xiao ,and DAC for all the goof info you’ll need. After a few posts you’ll get enough forum cred to post pictures, new topics and more stuff :+1: