I'm a total beginner in IoT. Infact this is my first project. I'm trying to build a digital clock using ESP32. It took me days to just setup a 7 segment display. But with great support from this community, I was finally able to setup the display and run a NTP clock on it. Now I want to go forward and play some audio. For ex., a sound effect when ESP is connected to WiFi, an alarm tone etc. But I'm having a really hard time to understand the basics of it.
I'm using PlatformIO in VSCode. I've tried many audio libraries but none them seems to work. While Xtronical is outdated, others are not available on PlatformIO. Espressif IDF & ADF are too overwhelming for a beginner like me.
Here's what I know so far:
Audio can be output in a different ways:
- Using internal 8-bit DACs
- Using external DACs for better quality
- Using PDM and PWM
While these details regarding what ESP32 can do are readily available on the internet, there isn't a single decent guide that shows how to implement them.
Here's what I want to achieve:
- Stores few basic tones in the ESP32 to play during certain trigger events, like when the device is connected to WiFi.
- Play songs from SDCard and/or USB.
Can someone spare some time to explain in detail how to do it? Or provide a link to a guide that explains it? I'd prefer the PDM/PWM approach because the 8-bit DAC quality is not suitable for songs and external DACs like MAX98357a are way too expensive in my region.
PS: Is it possible to salvage a DAC from any audio equipment that works with ESP32? If yes, what are they?