Audio & Video

  • audio
  • video

Which modules can directly drive a speaker for audio playback?

ESP32, ESP32-S2, ESP32-S3, ESP32-C3, and similar SoCs can output audio directly through PWM (LEDC) or DAC, making it possible to connect a simple speaker or earphones for playback. The output volume is limited, so this is suitable mainly for basic applications.

In the official examples, a speaker can be connected directly to GPIOs such as GPIO25/26 on ESP32 and GPIO1/2 on ESP32-S2/S3/C3, with a 47 Ω series resistor. Example:
https://github.com/espressif/esp-iot-solution/blob/master/examples/audio/wav_player/README.md

Note that most ESP32 modules do not integrate a power amplifier. Directly driving a high-power speaker usually results in low volume. If higher volume or better sound quality is required, use a development board with an external audio amplifier or add an amplifier circuit around the module.

A project uses both ES7210 and NS4168. They have the same channel count, sample rate, and bit depth. Can they share BCLK and LRCK?

Yes. ES7210 is an input device and NS4168 is an output device. I2S can support input and output at the same time, and the data directions are opposite, while the other clock signals can be shared.

Only one channel needs to be created. On ESP32-S3, I2S supports full-duplex operation. See:
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/api-reference/peripherals/i2s.html#id17