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

CobaltEcho
Posts: 7
Joined: Sun Aug 13, 2023 10:35 pm

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

Postby CobaltEcho » Sun Aug 13, 2023 10:44 pm

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.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » 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.

MicroController
Posts: 1725
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Mon Aug 14, 2023 2:22 pm

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.

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

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

Postby bidrohini » 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

CobaltEcho
Posts: 7
Joined: Sun Aug 13, 2023 10:35 pm

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

Postby CobaltEcho » Sun Aug 20, 2023 2:02 pm

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

CobaltEcho
Posts: 7
Joined: Sun Aug 13, 2023 10:35 pm

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

Postby CobaltEcho » Sun Aug 20, 2023 2:04 pm

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

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » 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.)

CobaltEcho
Posts: 7
Joined: Sun Aug 13, 2023 10:35 pm

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

Postby CobaltEcho » Wed Aug 30, 2023 3:01 am

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

Who is online

Users browsing this forum: No registered users and 302 guests