• sales

    +86-0755-88291180

Audio Playback Demo / Example Code

2026-02-23 00:20:12 Ask

I am trying to get the audio working on an ESP32-S3-LCD-1.28-BOX . It uses an NS4168 Class-D I2S amplifier (not an ES8311 as I initially thought).

What I know from the manufacturer:

  • I2S_DOUT = GPIO 10
  • PA_CTRL (Amplifier Enable) = GPIO 46
  • The init sequence requires PA_CTRL to be pulled LOW, then HIGH before playing.

The Problem:
I am using the ESP32-audioI2S library to play an MP3 from the SD card. The code runs perfectly, the SD card is mounted, the MP3 is found and decoded, and the serial monitor shows it "playing" at the correct speed/duration.
However, the speaker only outputs a constant static noise/hiss.

What I've tried:

  1. Toggling PA_CTRL (GPIO 46) works — the noise appears only when it's HIGH, meaning the amp is turning on.
  2. The manufacturer didn't provide the BCLK and LRC (WS) pins. I've tried guessing (9/45, 5/4, 17/18, etc.) and swapping them, but still only get static.
  3. Verified SD card pins (17, 18, 21, 13) and TFT pins — they are not conflicting with audio.
1answers
SpotPearUser3280
Answer time:
2026-02-23 14:19:59

This reminds me of troubleshooting a music guessing game like Heardle: everything “plays” on paper, but what you hear tells the real story. If the amp enable (PA_CTRL) is behaving, the constant hiss makes me think the I2S clocking/pin mapping is still off. Without confirmed BCLK and LRC/WS, it’s so easy to decode perfectly yet feed garbage to the DAC/amp.

Like1

report