esp32-audio-player 0.1.0
Audio player engine for ESP32
Loading...
Searching...
No Matches
audio_sink_t Struct Reference

#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)
 

Field Documentation

◆ buffered_frames

uint32_t(* audio_sink_t::buffered_frames) (audio_sink_t *s)

queued but not yet played

◆ caps

uint32_t audio_sink_t::caps

◆ close

void(* audio_sink_t::close) (audio_sink_t *s)

◆ ctx

void* audio_sink_t::ctx

◆ describe

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".

◆ flush

void(* audio_sink_t::flush) (audio_sink_t *s)

drop queued audio (seek, skip)

◆ name

const char* audio_sink_t::name

"wired", "bluetooth", "null", "wav"

◆ negotiate

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.

◆ open

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).

◆ pause

void(* audio_sink_t::pause) (audio_sink_t *s, bool paused)

pause output without dropping data

◆ set_volume_db

int(* audio_sink_t::set_volume_db) (audio_sink_t *s, float db)

hardware volume; -1 if unsupported

◆ write

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.


The documentation for this struct was generated from the following file: