Audio Player API
Overview
The audio player component provides lightweight audio playback functionality, supporting playlist management, playback control, volume adjustment, and event callbacks for playback status reporting. It is suitable for application scenarios that require managing the playback of multiple audio files.
For the audio player development guide, please refer to:
For the audio player example projects, please refer to:
API Reference
Header File
Functions
-
int bk_audio_player_new(bk_audio_player_handle_t *handle, bk_audio_player_cfg_t *cfg)
Create a new audio player instance.
- Parameters
handle – [out] On success, receives the new instance handle.
cfg – [in] Audio player configuration, see bk_audio_player_cfg_t.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
AUDIO_PLAYER_NO_MEM: Out of memory.
AUDIO_PLAYER_INVALID: Invalid parameter.
-
int bk_audio_player_delete(bk_audio_player_handle_t handle)
Destroy an audio player instance and release its resources.
- Parameters
handle – [in] Instance handle returned by bk_audio_player_new.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_INVALID: Invalid handle (e.g. NULL).
-
int bk_audio_player_set_play_mode(bk_audio_player_handle_t handle, audio_player_mode_t mode)
Set play mode.
- Parameters
handle – [in] Instance handle.
mode – [in] Play mode, see audio_player_mode_t.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_INVALID: Invalid parameter.
-
int bk_audio_player_set_volume(bk_audio_player_handle_t handle, int volume)
Set volume.
- Parameters
handle – [in] Instance handle.
volume – [in] Volume level, range 0-100.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_INVALID: Invalid parameter.
-
int bk_audio_player_get_volume(bk_audio_player_handle_t handle)
Get current volume.
- Parameters
handle – [in] Instance handle.
- Returns
Current volume level (0-100).
-
int bk_audio_player_clear_music_list(bk_audio_player_handle_t handle)
Clear music list.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
-
int bk_audio_player_add_music(bk_audio_player_handle_t handle, char *name, char *uri)
Add music to playlist.
- Parameters
handle – [in] Instance handle.
name – [in] Music name.
uri – [in] Music URI (URL or file path).
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
-
int bk_audio_player_del_music_by_name(bk_audio_player_handle_t handle, char *name)
Delete music from playlist by name.
- Parameters
handle – [in] Instance handle.
name – [in] Music name.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
-
int bk_audio_player_del_music_by_uri(bk_audio_player_handle_t handle, char *uri)
Delete music from playlist by URI.
- Parameters
handle – [in] Instance handle.
uri – [in] Music URI (URL or file path).
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
-
int bk_audio_player_start(bk_audio_player_handle_t handle)
Start playback.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_stop(bk_audio_player_handle_t handle)
Stop playback.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_pause(bk_audio_player_handle_t handle)
Pause playback.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_resume(bk_audio_player_handle_t handle)
Resume playback.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_ERR: Failed.
PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_prev(bk_audio_player_handle_t handle)
Play previous song.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_INVALID: No previous song available.
AUDIO_PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_next(bk_audio_player_handle_t handle)
Play next song.
- Parameters
handle – [in] Instance handle.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_INVALID: No next song available.
AUDIO_PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_jumpto(bk_audio_player_handle_t handle, int idx)
Jump to specific song in playlist.
- Parameters
handle – [in] Instance handle.
idx – [in] Song index in playlist.
- Returns
Error code.
AUDIO_PLAYER_OK: Success.
AUDIO_PLAYER_INVALID: Invalid index.
AUDIO_PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_seek(bk_audio_player_handle_t handle, int second)
Seek current track to the specified playback position.
Note
This API only works while playing local audio files.
- Parameters
handle – [in] Instance handle.
second – [in] Playback position in seconds from start of track.
- Returns
Error code.
AUDIO_PLAYER_OK: Success (seek request accepted).
AUDIO_PLAYER_NOT_INIT: Player not initialized.
-
int bk_audio_player_get_metadata_from_file(bk_audio_player_handle_t handle, const char *filepath, audio_metadata_t *metadata)
Extract metadata from an audio file.
This API opens the specified audio file and fills the metadata structure with available fields such as title, artist, genre, bitrate and duration. Uses the metadata parsers registered with the given instance.
- Parameters
handle – [in] Instance handle.
filepath – [in] Full path to the audio file.
metadata – [out] Pointer to metadata structure to be filled.
- Returns
0: Success.
-1: Error opening file.
-2: Unsupported file format.
-3: Invalid parameter.
-4: File read error.
-
int bk_audio_player_register_metadata_parser(bk_audio_player_handle_t handle, const bk_audio_player_metadata_parser_ops_t *ops)
Register a custom metadata parser implementation.
This API allows the user to register an external metadata parser for new audio formats. The provided ops structure must remain valid for the lifetime of the audio player instance.
- Parameters
handle – [in] Instance handle.
ops – [in] Pointer to metadata parser operations, see bk_audio_player_metadata_parser_ops_t.
- Returns
Error code.
AUDIO_PLAYER_OK: Parser registered successfully.
AUDIO_PLAYER_ERR: Invalid parameter or internal list not initialized.
-
int bk_audio_player_register_source(bk_audio_player_handle_t handle, const bk_audio_player_source_ops_t *ops)
Register a custom audio source implementation.
This API allows the user to register an external audio source, such as a new network protocol or storage backend. The provided ops structure must remain valid for the lifetime of the audio player instance.
- Parameters
handle – [in] Instance handle.
ops – [in] Pointer to audio source operations, see bk_audio_player_source_ops_t.
- Returns
Error code.
AUDIO_PLAYER_OK: Source registered successfully.
AUDIO_PLAYER_ERR: Invalid parameter or internal list not initialized.
-
int bk_audio_player_register_decoder(bk_audio_player_handle_t handle, const bk_audio_player_decoder_ops_t *ops)
Register a custom audio codec implementation.
This API allows the user to register an external decoder implementation for additional audio formats. The provided ops structure must remain valid for the lifetime of the audio player instance.
- Parameters
handle – [in] Instance handle.
ops – [in] Pointer to decoder operations, see bk_audio_player_decoder_ops_t.
- Returns
Error code.
AUDIO_PLAYER_OK: Codec registered successfully.
AUDIO_PLAYER_ERR: Invalid parameter or internal list not initialized.
-
int bk_audio_player_register_sink(bk_audio_player_handle_t handle, const bk_audio_player_sink_ops_t *ops)
Register a custom audio sink implementation.
This API allows the user to register an external audio sink, such as a new output device or file/stream writer. The provided ops structure must remain valid for the lifetime of the audio player instance.
- Parameters
handle – [in] Instance handle.
ops – [in] Pointer to audio sink operations, see bk_audio_player_sink_ops_t.
- Returns
Error code.
AUDIO_PLAYER_OK: Sink registered successfully.
AUDIO_PLAYER_ERR: Invalid parameter or internal list not initialized.
Built-in Decoder Plugins
The following APIs return the decoder ops table for each format; use with bk_audio_player_register_decoder().
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_aac_decoder_ops(void)
Get AAC decoder operations table.
This function returns a pointer to the statically defined AAC decoder operations structure implemented in bk_audio_player_aac_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for AAC decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_amr_decoder_ops(void)
Get AMR decoder operations table.
This function returns a pointer to the statically defined AMR decoder operations structure implemented in bk_audio_player_amr_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for AMR decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_flac_decoder_ops(void)
Get FLAC decoder operations table.
This function returns a pointer to the statically defined FLAC decoder operations structure implemented in bk_audio_player_flac_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for FLAC decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_m4a_decoder_ops(void)
Get M4A decoder operations table.
This function returns a pointer to the statically defined M4A decoder operations structure implemented in bk_audio_player_m4a_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for M4A decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_mp3_decoder_ops(void)
Get MP3 decoder operations table.
This function returns a pointer to the statically defined MP3 decoder operations structure implemented in bk_audio_player_mp3_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for MP3 decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_ogg_decoder_ops(void)
Get OGG Vorbis decoder operations table.
This function returns a pointer to the statically defined OGG decoder operations structure implemented in bk_audio_player_ogg_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for OGG decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_opus_decoder_ops(void)
Get OPUS decoder operations table.
This function returns a pointer to the statically defined OPUS decoder operations structure implemented in bk_audio_player_opus_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for OPUS decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_ts_decoder_ops(void)
Get TS (MPEG-TS) decoder operations table.
This function returns a pointer to the statically defined TS decoder operations structure implemented in bk_audio_player_ts_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for TS decoder.
Header File
Functions
-
const bk_audio_player_decoder_ops_t *bk_audio_player_get_wav_decoder_ops(void)
Get WAV decoder operations table.
This function returns a pointer to the statically defined WAV decoder operations structure implemented in bk_audio_player_wav_decoder.c, which can be used with bk_audio_player_register_decoder().
- Returns
Pointer to constant bk_audio_player_decoder_ops_t for WAV decoder.
Built-in Metadata Parser Plugins
The following APIs return the metadata parser ops table for each format; use with bk_audio_player_register_metadata_parser().
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_aac_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_amr_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_flac_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_m4a_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_mp3_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_ogg_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_opus_metadata_parser_ops(void)
Header File
Functions
-
const bk_audio_player_metadata_parser_ops_t *bk_audio_player_get_wav_metadata_parser_ops(void)
Built-in Source Plugins
The following APIs return the audio source ops table; use with bk_audio_player_register_source().
Header File
Functions
-
const bk_audio_player_source_ops_t *bk_audio_player_get_file_source_ops(void)
Get file source operations table.
This function returns a pointer to the statically defined file source operations structure implemented in bk_audio_player_file_source.c. The returned pointer can be passed to bk_audio_player_register_source().
- Returns
Pointer to constant bk_audio_player_source_ops_t for file source.
Header File
Functions
-
const bk_audio_player_source_ops_t *bk_audio_player_get_hls_source_ops(void)
Get HLS (HTTP Live Streaming) source operations table.
This function returns a pointer to the statically defined HLS source operations structure implemented in bk_audio_player_hls_source.c. The returned pointer can be passed to bk_audio_player_register_source().
- Returns
Pointer to constant bk_audio_player_source_ops_t for HLS source.
Header File
Functions
-
const bk_audio_player_source_ops_t *bk_audio_player_get_net_source_ops(void)
Get HTTP network source operations table.
This function returns a pointer to the statically defined HTTP network source operations structure implemented in bk_audio_player_net_source.c. The returned pointer can be passed to bk_audio_player_register_source().
- Returns
Pointer to constant bk_audio_player_source_ops_t for network source.
Built-in Output Plugins (Sink)
The following APIs return the audio sink ops table; use with bk_audio_player_register_sink().
Header File
Functions
-
const bk_audio_player_sink_ops_t *bk_audio_player_get_file_sink_ops(void)
Get file sink operations table.
This function returns a pointer to the statically defined file sink operations structure implemented in bk_audio_player_file_sink.c. The returned pointer can be passed to bk_audio_player_register_sink().
- Returns
Pointer to constant bk_audio_player_sink_ops_t for file sink.
Header File
Functions
-
const bk_audio_player_sink_ops_t *bk_audio_player_get_onboard_speaker_sink_ops(void)
Get onboard speaker sink operations table.
This function returns a pointer to the statically defined onboard speaker sink operations structure. The returned pointer can be passed to bk_audio_player_register_sink().
- Returns
Pointer to constant bk_audio_player_sink_ops_t for onboard speaker sink.
API Typedefs
Header File
Structures
-
struct audio_metadata_t
Audio metadata structure.
Holds parsed metadata for a track (title, artist, album, etc.) and basic stream info (duration, bitrate, sample rate, channels).
Public Members
-
char title[AUDIO_METADATA_MAX_STRING_LEN]
Track title
-
char artist[AUDIO_METADATA_MAX_STRING_LEN]
Artist
-
char album[AUDIO_METADATA_MAX_STRING_LEN]
Album
-
char album_artist[AUDIO_METADATA_MAX_STRING_LEN]
Album artist
-
char genre[AUDIO_METADATA_MAX_STRING_LEN]
Genre
-
char year[AUDIO_METADATA_MAX_STRING_LEN]
Year
-
char composer[AUDIO_METADATA_MAX_STRING_LEN]
Composer
-
char track_number[AUDIO_METADATA_MAX_STRING_LEN]
Track number
-
double duration
Duration in seconds
-
int bitrate
Bitrate in bps
-
int sample_rate
Sample rate in Hz
-
int channels
Channel count
-
int has_id3v1
Whether ID3v1 tag is present
-
int has_id3v2
Whether ID3v2 tag is present
-
char title[AUDIO_METADATA_MAX_STRING_LEN]
-
struct bk_audio_player_source_ops
Audio source operations.
Callbacks implemented by a source plugin to open a URL, read data, and optionally seek.
Public Members
-
int (*open)(char *url, bk_audio_player_source_t **source_pp)
Open URL and create source instance
-
int (*get_codec_type)(bk_audio_player_source_t *source)
Return audio_format_t for stream
-
uint32_t (*get_total_bytes)(bk_audio_player_source_t *source)
Total bytes (optional)
-
int (*read)(bk_audio_player_source_t *source, char *buffer, int len)
Read data
-
int (*seek)(bk_audio_player_source_t *source, int offset, uint32_t whence)
Seek (optional)
-
int (*close)(bk_audio_player_source_t *source)
Close and release
-
int (*open)(char *url, bk_audio_player_source_t **source_pp)
-
struct bk_audio_player_sink_ops
Audio sink operations.
Callbacks implemented by a sink plugin to open output, write PCM, and control (pause/resume/volume).
Public Members
-
int (*open)(audio_sink_type_t sink_type, void *param, bk_audio_player_sink_t **sink_pp)
Open sink
-
int (*write)(bk_audio_player_sink_t *sink, char *buffer, int len)
Write PCM data
-
int (*control)(bk_audio_player_sink_t *sink, audio_sink_control_t control)
Control (optional)
-
int (*close)(bk_audio_player_sink_t *sink)
Close and release
-
int (*open)(audio_sink_type_t sink_type, void *param, bk_audio_player_sink_t **sink_pp)
-
struct audio_info_s
Decoded stream / frame information.
Describes channel count, sample rate, sample bits, frame size, bitrate, and duration.
Public Members
-
int channel_number
Number of channels
-
int sample_rate
Sample rate in Hz
-
int sample_bits
Bits per sample
-
int frame_size
Frame size in bytes
-
int bps
Bits per second
-
uint32_t total_bytes
Total bytes in stream (if known)
-
uint32_t header_bytes
Header size in bytes
-
double duration
Duration in milliseconds
-
int channel_number
-
struct bk_audio_player_decoder_ops
Audio decoder operations.
Callbacks implemented by a decoder plugin to open by format, get stream info, and decode data.
Public Members
-
const char *name
Decoder name identifier (e.g. “aac”, “mp3”, “wav”)
-
int (*open)(audio_format_t format, void *param, bk_audio_player_decoder_t **decoder_pp)
Open decoder
-
int (*get_info)(bk_audio_player_decoder_t *decoder, audio_info_t *info)
Get stream info
-
int (*get_chunk_size)(bk_audio_player_decoder_t *decoder)
Preferred chunk size
-
int (*get_data)(bk_audio_player_decoder_t *decoder, char *buffer, int len)
Decode and return PCM
-
int (*close)(bk_audio_player_decoder_t *decoder)
Close
-
int (*calc_position)(bk_audio_player_decoder_t *decoder, int second)
Byte offset for seek
-
int (*is_seek_ready)(bk_audio_player_decoder_t *decoder)
Whether seek is ready
-
const char *name
-
struct bk_audio_player_metadata_parser_ops
Metadata parser operations.
Callbacks to probe file type and parse metadata (e.g. ID3, Vorbis comment) into audio_metadata_t.
Public Members
-
const char *name
Parser name identifier
-
audio_format_t format
Format this parser handles (e.g. AUDIO_FORMAT_MP3, AUDIO_FORMAT_WAV)
-
int (*probe)(const char *filepath)
Probe whether this parser supports the file
-
int (*parse)(int fd, const char *filepath, audio_metadata_t *metadata)
Parse metadata into structure
-
const char *name
-
struct audio_player_seek_result_t
Result payload for AUDIO_PLAYER_EVENT_SEEK_COMPLETE.
-
struct bk_audio_player_cfg_t
Audio player configuration structure.
This structure defines the configuration parameters for the audio player, including event handling, user-defined parameters, and internal task settings.
Public Members
-
uint32_t task_stack
Stack size in bytes for the player internal task; 0 to use default
-
int task_prio
Priority for the player internal task; follows RTOS convention (e.g. BEKEN_DEFAULT_WORKER_PRIORITY)
-
audio_player_event_handler_func event_handler
Event handler callback function
-
void *args
User defined arguments for the event handler function
-
uint32_t task_stack
Macros
-
AUDIO_PLAYER_MODE_DEFAULT
Default audio player mode.
-
AUDIO_METADATA_MAX_STRING_LEN
Maximum length of metadata string fields (e.g. title, artist)
-
AUDIO_PLAYER_DEFAULT_TASK_STACK
Default stack size for the player internal task (bytes)
-
DEFAULT_AUDIO_PLAYER_CONFIG()
Default audio player configuration.
This configuration defines default settings for audio player initialization:
Event handler: NULL (no event handling)
User arguments: NULL (no user data)
task_stack: AUDIO_PLAYER_DEFAULT_TASK_STACK
task_prio: BEKEN_DEFAULT_WORKER_PRIORITY
Type Definitions
-
typedef struct bk_audio_player_source bk_audio_player_source_t
Opaque source instance; see bk_audio_player_source_ops_t for operations
-
typedef struct bk_audio_player_source_ops bk_audio_player_source_ops_t
Audio source operations.
Callbacks implemented by a source plugin to open a URL, read data, and optionally seek.
-
typedef struct bk_audio_player_sink bk_audio_player_sink_t
Opaque sink instance; see bk_audio_player_sink_ops_t for operations
-
typedef struct bk_audio_player_sink_ops bk_audio_player_sink_ops_t
Audio sink operations.
Callbacks implemented by a sink plugin to open output, write PCM, and control (pause/resume/volume).
-
typedef struct bk_audio_player_decoder bk_audio_player_decoder_t
Opaque decoder instance; see bk_audio_player_decoder_ops_t for operations
-
typedef struct audio_info_s audio_info_t
Decoded stream / frame information.
Describes channel count, sample rate, sample bits, frame size, bitrate, and duration.
-
typedef struct bk_audio_player_decoder_ops bk_audio_player_decoder_ops_t
Audio decoder operations.
Callbacks implemented by a decoder plugin to open by format, get stream info, and decode data.
-
typedef struct bk_audio_player_metadata_parser_ops bk_audio_player_metadata_parser_ops_t
Metadata parser operations.
Callbacks to probe file type and parse metadata (e.g. ID3, Vorbis comment) into audio_metadata_t.
-
typedef void (*audio_player_event_handler_func)(audio_player_event_type_t event, void *extra_info, void *args)
Event handler function type.
- Param event
Event type, see audio_player_event_type_t
- Param extra_info
Extra information for the event
- Param args
User defined arguments
-
typedef struct bk_audio_player *bk_audio_player_handle_t
Opaque handle for an audio player instance. Each instance has its own plugin lists and state; multiple instances can coexist.
Enumerations
-
enum audio_player_error_code_t
Generic Audio Player Types.
This file defines the common data types, enumerations, and structures used by the audio player module. These types are used to configure and control audio playback operations including playlist management, playback control, and event handling.
Audio player error code definitions
Values:
-
enumerator AUDIO_PLAYER_OK
Operation successful
-
enumerator AUDIO_PLAYER_ERR
General error
-
enumerator AUDIO_PLAYER_NOT_INIT
Audio player not initialized
-
enumerator AUDIO_PLAYER_NO_MEM
Out of memory
-
enumerator AUDIO_PLAYER_PROGRESS
Operation in progress
-
enumerator AUDIO_PLAYER_INVALID
Invalid parameter
-
enumerator AUDIO_PLAYER_TIMEOUT
Operation timeout
-
enumerator AUDIO_PLAYER_OK
-
enum audio_player_mode_t
Audio player mode definitions.
Values:
-
enumerator AUDIO_PLAYER_MODE_ONE_SONG
Play single song
-
enumerator AUDIO_PLAYER_MODE_SEQUENCE
Play in sequence
-
enumerator AUDIO_PLAYER_MODE_ONE_SONG_LOOP
Loop single song
-
enumerator AUDIO_PLAYER_MODE_SEQUENCE_LOOP
Loop sequence
-
enumerator AUDIO_PLAYER_MODE_RANDOM
Random play
-
enumerator AUDIO_PLAYER_MODE_ONE_SONG
-
enum audio_player_event_type_t
Audio player event type definitions.
Values:
-
enumerator AUDIO_PLAYER_EVENT_SONG_START
Song started
-
enumerator AUDIO_PLAYER_EVENT_SONG_FINISH
Song finished
-
enumerator AUDIO_PLAYER_EVENT_SONG_FAILURE
Song playback failed
-
enumerator AUDIO_PLAYER_EVENT_SONG_PAUSE
Song paused
-
enumerator AUDIO_PLAYER_EVENT_SONG_RESUME
Song resumed
-
enumerator AUDIO_PLAYER_EVENT_SONG_TICK
Song playback tick
-
enumerator AUDIO_PLAYER_EVENT_SEEK_COMPLETE
Seek operation finished
-
enumerator AUDIO_PLAYER_EVENT_LAST
-
enumerator AUDIO_PLAYER_EVENT_SONG_START
-
enum audio_format_t
Audio format enumeration.
Used by metadata parser ops and decoder selection. Each value corresponds to a supported container or codec type.
Values:
-
enumerator AUDIO_FORMAT_UNKNOWN
Unknown or unsupported format
-
enumerator AUDIO_FORMAT_MP3
MP3
-
enumerator AUDIO_FORMAT_WAV
WAV
-
enumerator AUDIO_FORMAT_AAC
AAC
-
enumerator AUDIO_FORMAT_AMR
AMR
-
enumerator AUDIO_FORMAT_FLAC
FLAC
-
enumerator AUDIO_FORMAT_OGG
OGG
-
enumerator AUDIO_FORMAT_OPUS
Opus
-
enumerator AUDIO_FORMAT_M4A
M4A
-
enumerator AUDIO_FORMAT_TS
MPEG-TS
-
enumerator AUDIO_FORMAT_UNKNOWN
-
enum audio_sink_type_t
Audio sink type.
Identifies the kind of output: device (e.g. speaker) or file.
Values:
-
enumerator AUDIO_SINK_DEVICE
Output to audio device (e.g. onboard speaker)
-
enumerator AUDIO_SINK_FILE
Output to file
-
enumerator AUDIO_SINK_DEVICE
-
enum audio_sink_control_t
Audio sink control command.
Commands that can be sent to a sink via the control callback.
Values:
-
enumerator AUDIO_SINK_PAUSE
Pause playback
-
enumerator AUDIO_SINK_RESUME
Resume playback
-
enumerator AUDIO_SINK_MUTE
Mute
-
enumerator AUDIO_SINK_UNMUTE
Unmute
-
enumerator AUDIO_SINK_FRAME_INFO_CHANGE
Frame format changed
-
enumerator AUDIO_SINK_SET_VOLUME
Set volume
-
enumerator AUDIO_SINK_PAUSE