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.
Is is possible to use a ESP32 WROOM Dev board as an audio player using SD Reader, Wav files, an onboard decoders?
-
- Posts: 7
- Joined: Sun Aug 13, 2023 10:35 pm
-
- 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?
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.
-
- 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?
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.
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?
For playing wav files you can use a MAX98357A I2S Decoder :
https://www.youtube.com/watch?v=cnBDMpMSeQI
https://www.youtube.com/watch?v=cnBDMpMSeQI
-
- 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?
ESP_Sprite wrote: ↑Mon Aug 14, 2023 2:44 amIt'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
-
- 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?
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.bidrohini wrote: ↑Mon Aug 14, 2023 3:08 pmFor playing wav files you can use a MAX98357A I2S Decoder :
https://www.youtube.com/watch?v=cnBDMpMSeQI
https://www.amazon.com/HiLetgo-TPA3118- ... B01HXU1G02
-
- 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?
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.)
-
- 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?
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:ESP_Sprite wrote: ↑Tue Aug 29, 2023 12:51 amThere'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.)
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 282 guests