About this project

The ESP32-A2DP library provides a simple Arduino-compatible interface for Bluetooth A2DP audio streaming on Espressif ESP32 microcontrollers. It implements both A2DP Sink (music receiver) and A2DP Source (music sender) roles, allowing projects like Bluetooth speakers or wireless audio transmitters. The library wraps ESP-IDF's Bluedroid stack and exposes callbacks for PCM data, AVRCP metadata (title, artist, playing time), playback notifications (status, position, track change), and remote control commands (play, pause, next, previous, etc.). Output can be routed to I2S (external DAC), the internal ESP32 DAC, or any Arduino Print-derived stream. Since ESP-IDF v5 / Arduino core 3.0 the legacy I2S API is deprecated; the library now recommends the companion AudioTools library for a version-independent audio pipeline, but also works directly with the new ESP32 I2SClass. Non-SBC codecs such as AAC require ESP-IDF ≥ 6.1 and an AudioTools decoder registered via add_decoder(). The code has no external dependencies beyond ESP-IDF (provided by the Arduino ESP32 core) and supports three build environments: Arduino IDE, PlatformIO, and ESP-IDF as a component. Comprehensive examples cover basic sink/source, pin configuration, metadata handling, FFT analysis, and multi-codec setups. Documentation includes class reference, wiki with design overview, PlatformIO/IDF integration guides, and change history. Licensed under Apache 2.0.