Got a speaker and sound?

Hello, I’m using an esp32 C3 board. I know it doesn’t have an audio (DAC). I’m trying to get a good audio sound like a Cellphone haves when on speaker phone to play some music for a music player. Everything I found so far sounds like garbage. I’m not sure if it’s the I2c (DAC) or the speaker itself. I’m wondering what does cellphones use to make the sound so clear? Everything I found online says it’s mostly integrated into the main processor itself. a few few say some phones have an external chip But not naming what it is they use. Does anyone know of a good small micro speaker that can play audio clips clearly?

Joseph

Probably “i2s”, a serial digital protocol aimed specifically at audio.
I believe you can get chips with i2s DACs and audio amp all in one.
I also believe that the esp32 chips support i2s.

Standard ESP32 boards have DACs, just not the one your using, so the sound probably isn’t the greatest if using PWM.

It would be very clear if using a real DAC.

There are a number of libraries available for audio playback, decoding etc for ESP32.

The Teensy also comes to mind if you are looking for high quality audio.

I’ve also written an audio library for Arduino Due and nRF52x devices that uses I2S as well. GitHub - TMRh20/AutoAnalogAudio: Create a wide range of sampling and audio related applications with simple API for onboard DAC (or PWM), ADC, DMA & Timers on Arduino devices (AVR & SAM) · GitHub

Hi @josephchrzempiec !

here is a comparison of different ESP32 versions, incl. the C3 controller:

https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32c3/hw-reference/chip-series-comparison.html

Your C3 should have I2S available (one channel) that can be configured to operate with 8/16/24/32-bit resolution as an input or output.

So if you are interested how to use it this page may be a great source of information (e.g. about external DACs) and code:

https://github.com/pschatzmann/arduino-audio-tools/wiki

Good luck!
ec2021

@ec2021 thenk you I’m looking at that now.

Hey @westfw my esp32 doesn’t support or have a (DAC) I need to use an external one.

@TMRh20 I have tired to use an external cjip I have with the small speaker I have. It is very tinted and muffled. It might be the speaker I honest don’t know it’s a very tiny speaker I oulled from a cell phone.

Yes, but it does do I2S, so look for something like Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A : Adafruit Industries, Unique & fun DIY electronics and kits - DAC and Amp in one chip. (Cheaper versions from Aliexpress/etc.)

Can you post the type of DAC you used?

@westfw I’m looking at them now. Thank you.

I got it from Amazon. https://a.co/d/01CpooIw

Please post a readable link ... This one does not work for me

Unfortunately the shortcut link didn't lead me to the page... Thanks @xfpd !

@josephchrzempiec : Looks as if this DAC board provides stereo line level output that is prepared for line-in of an amplifier, not for direct replay.

See here https://en.wikipedia.org/wiki/Line_level

That explains the low output power.

Check the datasheet of your DAC board to verify!

ec2021