|
| static int | ap_a2dp_negotiate (audio_sink_t *s, const audio_format_t *src, audio_format_t *out) |
| | The player resamples everything to 44.1 kHz for this sink and keeps its DSP output at 32 bits; the sink adds the one TPDF dither to 16 bits.
|
| |
| static int | ap_a2dp_open (audio_sink_t *s, const audio_format_t *fmt) |
| |
| static int32_t | ap_a2dp_write (audio_sink_t *s, const int32_t *pcm, uint32_t frames, uint32_t timeout_ms) |
| |
| static void | ap_a2dp_pause (audio_sink_t *s, bool paused) |
| |
| static void | ap_a2dp_flush (audio_sink_t *s) |
| |
| static int | ap_a2dp_set_volume_db (audio_sink_t *s, float db) |
| |
| static uint32_t | ap_a2dp_buffered_frames (audio_sink_t *s) |
| |
| static void | ap_a2dp_describe (audio_sink_t *s, char *out, size_t out_size) |
| |
| static void | ap_a2dp_close (audio_sink_t *s) |
| |
| static audio_sink_t * | audio_player_a2dp_sink (void) |
| | The sink. Call after a2dp_xq_init(); it stays valid until a2dp_xq_deinit().
|
| |
| static void | audio_player_a2dp_remote (a2dp_xq_remote_t cmd, int value, void *user) |
| | a2dp_xq_config_t.remote_cb with remote_user = the player: the headphone buttons control the player, their own volume changes become the player volume, and a lost link pauses.
|
| |
Bluetooth headphones as a player output, through the esp32-a2dp-xq library (https://github.com/olerast67/esp32-a2dp-xq; Arduino: install it from the Library Manager, ESP-IDF: add olerast67/esp32-a2dp-xq to your idf_component.yml).
Header-only on purpose: include it in the one source file that sets up the player, so this library builds without esp32-a2dp-xq when you do not use Bluetooth.
a2dp_xq_config_t bt = A2DP_XQ_CONFIG_DEFAULT(); bt.remote_cb = audio_player_a2dp_remote; // buttons and volume on the headphones bt.remote_user = player; // set after audio_player_start() a2dp_xq_init(&bt); player_cmd_set_sink(player, audio_player_a2dp_sink());