Playing PCM, DPCM or ADPCM in ESP32

I recently bought a classic ESP32 for the Bluetooth, WiFi and ESPECIALLY... the DAC

I'm experimenting with audio right now and i want to see a method to stream continuously trough the USB a PCM audio or the classic NES style of DPCM, and then play it trough the DAC of the ESP32, I need to say that I don't have any I2S module or anything, I bought the ESP32 for its current capabilities and ESPECIALLY the DAC

What is your question?

That sounds like an interesting project that would be a lot of fun! However, Please keep in mind that we are not a free design or code-writing service. We’re more than happy to help with your design or code, but we need you to make an initial attempt. Please design and write your code, then post it along with an annotated schematic and an explanation of what’s not working properly. There is also a for hire section if you want to pay for it.

  1. Show Your Work First: Before asking for assistance, make an attempt to design or write the code yourself. Share your work along with details about what isn’t working. That includes a preliminary schematic that you drew.
  2. Provide Clear Documentation: Since we can’t see your project, share an annotated schematic (best) or a clear drawing of your setup. Clear Pictures are welcome, but avoid using Fritzing diagrams as they are wiring diagrams, not schematics, and are not ideal for troubleshooting.
  3. Include Technical Details: If there is specific hardware involved, include links to technical information. There are often many versions of similar components, so precise details are essential. I will assume the processor is a UNO. Many times the processor is stated as ESP32, please state which one and post a link to it.
  4. Reference Resources: For additional help, check out useful links and tutorials: Useful Links on Arduino Forum. Of course one of the better sources of information (in my opinion) is the Arduino Cookbook. Skim it cover to cover and stop on any project that interests you.

Im using an LM386 N1 as audio amplifier

You still haven't asked a question.

I'm curious why you chose that topology. I would have gone with digital audio. Run I2S from the ESP32 to an I2S, (Class D) amplifier. That gets you stereo sound and a noise-free digital connection to the amp.

presumaly simple and low-tech. Seems the OP is just trying to study audio coding.

the phone company uses mu-law codecs which non-linearly compressed ~14-bit value to 8-bits using 64-kbit data to carry voice. These other encoding methods probably also expect a similar range a values i.e. ~14+-bits.

That's because I don't have a class D amplifier, not even a proper ESP32 lol

(I2S class D amplifier)

Adafruit has several.

For really big sound (20W / channel), I used an Infineon Eval Board with their Class D I2S amp on it. That board seems to be discontinued, but they may have a replacement.

bro.. I just want sound, not a freaking concert :sob:

Which is why I referenced the lower-power ones you can get from Adafruit.

Oh. mmmo kay, but the combo problems are here:

I live in Mexico

I have low budget ($11 dollars average every week)

I don't have a high coding skill

What's a peanut

I have an incorrect amplifier

My computer is a laptop

Dunno how much will shipments last

I like trains

I have low amount of cables

And I finished my combo!

why wouldn't an lm386 work for him?