|
esp32-audio-player 0.1.0
Audio player engine for ESP32
|
#include <sink.h>
Data Fields | |
| const char * | name |
| "wired", "bluetooth", "null", "wav" | |
| uint32_t | caps |
| void * | ctx |
| int(* | negotiate )(audio_sink_t *s, const audio_format_t *src, audio_format_t *out) |
| Given the decoded format, fill *out with the format the sink will accept. | |
| int(* | open )(audio_sink_t *s, const audio_format_t *fmt) |
| Start or reconfigure for fmt. May mute and block briefly (clock switch). | |
| int32_t(* | write )(audio_sink_t *s, const int32_t *pcm, uint32_t frames, uint32_t timeout_ms) |
| Write interleaved Q31 frames. | |
| void(* | pause )(audio_sink_t *s, bool paused) |
| pause output without dropping data | |
| void(* | flush )(audio_sink_t *s) |
| drop queued audio (seek, skip) | |
| int(* | set_volume_db )(audio_sink_t *s, float db) |
| hardware volume; -1 if unsupported | |
| uint32_t(* | buffered_frames )(audio_sink_t *s) |
| queued but not yet played | |
| void(* | describe )(audio_sink_t *s, char *out, size_t out_size) |
| Human-readable detail for the status bar, e.g. "SBC-XQ 452 kbps" or "PCM5102A". | |
| void(* | close )(audio_sink_t *s) |
| uint32_t(* audio_sink_t::buffered_frames) (audio_sink_t *s) |
queued but not yet played
| uint32_t audio_sink_t::caps |
| void(* audio_sink_t::close) (audio_sink_t *s) |
| void* audio_sink_t::ctx |
| void(* audio_sink_t::describe) (audio_sink_t *s, char *out, size_t out_size) |
Human-readable detail for the status bar, e.g. "SBC-XQ 452 kbps" or "PCM5102A".
| void(* audio_sink_t::flush) (audio_sink_t *s) |
drop queued audio (seek, skip)
| const char* audio_sink_t::name |
"wired", "bluetooth", "null", "wav"
| int(* audio_sink_t::negotiate) (audio_sink_t *s, const audio_format_t *src, audio_format_t *out) |
Given the decoded format, fill *out with the format the sink will accept.
Wired: same rate if the DAC supports it. Bluetooth: 44100/48000, 16 bits.
| int(* audio_sink_t::open) (audio_sink_t *s, const audio_format_t *fmt) |
Start or reconfigure for fmt. May mute and block briefly (clock switch).
| void(* audio_sink_t::pause) (audio_sink_t *s, bool paused) |
pause output without dropping data
| int(* audio_sink_t::set_volume_db) (audio_sink_t *s, float db) |
hardware volume; -1 if unsupported
| int32_t(* audio_sink_t::write) (audio_sink_t *s, const int32_t *pcm, uint32_t frames, uint32_t timeout_ms) |
Write interleaved Q31 frames.
Blocks up to timeout_ms when the output buffer is full. Returns frames accepted (may be fewer than requested) or <0.