DAC & Inventor 2040 W

I’m looking at getting the Inventor board to output high-quality sound (audio/music) for simple sound effects. Any suggestions for how could I achieve this?

I am using MicroPython so it would need to be I2S compatible. Even better if I can use the Audio out of the Inventor board.

From my research the board is only capable of playing simple sounds.

For I2S, you need three pins. Probably GP0-GP2 will do. You can connect these pins to an audio DAC. I like the MAX98357A, PCM5102A or UDA1334A. The first one is a mono amp and you can attach a speaker directly to the board. The second usually has a 3.5mm plug and gives stereo line-out (i.e. you need an additional amplifier for that). The same is true for the third DAC.

Once this is set up, you can use an example from GitHub - miketeachman/micropython-i2s-examples: Examples for I2S support on microcontrollers that run MicroPython to play wav-files.

Edit: you asked for “high-quality sound for simple sound effects”. This is a bit contradictory. Just for completeness: the Inventor 2040W has a builtin PAM8301, which is an amplifier and uses a single PWM-pin for audio. I bet you probably won’t notice the difference unless you use a stereo line-level I2S-DAC combined with a good amp and speakers. So unless you really need “high-quality sound”, I would keep it simple and stick to that.

Thanks for your help! I’m planning on playing some small voice clips, so I guess they are ‘simple’ to me, but probably quite a complex for the board.

I’ll pick up the MAX98357A, so I get the integrated DAC. I don’t need stereo for voice clips.