Page 1 of 1

Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Sun Aug 13, 2023 10:44 pm
by CobaltEcho
My first ESP32 project. I'm trying to make a basic audio player that plays the Wav files from a SD card reader strait to a speaker.

All the examples I'm finding seem to be using an external DAC. I know this is needed for mp3's, but didn't think so for Wav files.

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Mon Aug 14, 2023 2:44 am
by ESP_Sprite
It's not needed for either; the downside is that the internal DAC is only 8 bit so the audio will sound quite crusty. You will need some kind of amplifier before the speaker as well; the internal DAC isn't really intended to drive large loads.

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Mon Aug 14, 2023 2:22 pm
by MicroController
A DAC is not a "decoder" for mp3's or the like. It's a digital-to-analog converter.
The common way to produce good quality audio output with an ESP is to have it output a digital I2S audio stream, which an external (I2S) DAC then turns into analog audio signals of good resolution and sampling rate.

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Mon Aug 14, 2023 3:08 pm
by bidrohini
For playing wav files you can use a MAX98357A I2S Decoder :

https://www.youtube.com/watch?v=cnBDMpMSeQI

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Sun Aug 20, 2023 2:02 pm
by CobaltEcho
ESP_Sprite wrote:
Mon Aug 14, 2023 2:44 am
It's not needed for either; the downside is that the internal DAC is only 8 bit so the audio will sound quite crusty. You will need some kind of amplifier before the speaker as well; the internal DAC isn't really intended to drive large loads.

Thanks for the info, I think I'm ok with crusty because this is really just for a sound box for halloween to give background and sound effects. Using an amp is exactly what I intended. I found a higher powered amp to drive a 30-60w/4in speaker. The problem I'm having with using external DAC's is that they all have their own built in amps which is for like a 3w speaker or something. I need the oomph of my larger (TPA3118) amp. https://www.amazon.com/HiLetgo-TPA3118- ... B01HXU1G02

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Sun Aug 20, 2023 2:04 pm
by CobaltEcho
bidrohini wrote:
Mon Aug 14, 2023 3:08 pm
For playing wav files you can use a MAX98357A I2S Decoder :

https://www.youtube.com/watch?v=cnBDMpMSeQI
I was going that route, but those have their own built in amps for a 3w speaker or something. I need an un-amplified signal so I can send it to my TPA3118 amp to drive a larger speaker.
https://www.amazon.com/HiLetgo-TPA3118- ... B01HXU1G02

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Tue Aug 29, 2023 12:51 am
by ESP_Sprite
There's actually a fair amount of line-level codecs as well (more than there are ones with integrated amps, actually), the PCM5102 and ES9023 are examples. (If you use one of those, I'd suggest the PCM5102 as it doesn't need a MCLK.)

Re: Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?

Posted: Wed Aug 30, 2023 3:01 am
by CobaltEcho
ESP_Sprite wrote:
Tue Aug 29, 2023 12:51 am
There's actually a fair amount of line-level codecs as well (more than there are ones with integrated amps, actually), the PCM5102 and ES9023 are examples. (If you use one of those, I'd suggest the PCM5102 as it doesn't need a MCLK.)
I was hoping I could use the SD pin on the MAX98357 to just turn off the amplification part, but it just turns it totally off:

Code: Select all

If SD is connected to ground directly (voltage is under 0.16V) then the amp is shut down