esp32-audio-player 0.1.0
Audio player engine for ESP32
Loading...
Searching...
No Matches
esp32.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
18#pragma once
19
20#include "audio_player/events.h"
21#include "audio_player/player.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
29
46
48#define AUDIO_PLAYER_ESP32_CONFIG_DEFAULT() \
49 { \
50 .sink = NULL, .library = NULL, .state_dir = NULL, .scrobble_log = false, .volume_default_db = -20.0f, \
51 .volume_max_db = 0.0f, .volume_step_db = 1.0f, .task_stack = 24576, .task_priority = 18, \
52 .task_core = 1, .on_event = NULL, .on_event_user = NULL, .log_level = CORE_LOG_INFO, \
53 }
54
62
63#ifdef __cplusplus
64}
65#endif
core_log_level_t
Logging. The platform installs a sink; default prints to stderr.
Definition base.h:63
void audio_player_port_init(core_log_level_t max_level)
Idempotent. max_level limits the core's log output (CORE_LOG_INFO is a good default).
player_t * audio_player_start(const audio_player_esp32_config_t *cfg)
Initialise the port, create the player and start its audio task.
void audio_player_stop(player_t *p)
Stop the audio task and destroy the player.
Events from the player to the application.
void(* core_event_sink_t)(const core_event_t *ev, void *user)
Definition events.h:34
struct library library_t
Definition library.h:81
Playback engine: queue, gapless transitions, DSP, output negotiation, resume.
struct player player_t
Definition player.h:111
Definition esp32.h:30
uint32_t task_stack
bytes of internal RAM for the audio task; the MP3 decoder alone takes about 16 KB of it per frame (mi...
Definition esp32.h:38
library_t * library
optional music library index
Definition esp32.h:32
core_event_sink_t on_event
optional: player events (called from the audio task)
Definition esp32.h:42
int8_t task_core
core to pin the audio task to, -1 = any
Definition esp32.h:41
void * on_event_user
Definition esp32.h:43
bool scrobble_log
write a Rockbox-format .scrobbler.log into state_dir
Definition esp32.h:34
float volume_step_db
player_cmd_volume_step() increment
Definition esp32.h:37
audio_sink_t * sink
output, may be NULL and set later with player_cmd_set_sink()
Definition esp32.h:31
float volume_default_db
first volume when there is no saved state
Definition esp32.h:35
float volume_max_db
upper volume limit (hearing protection), <= 0
Definition esp32.h:36
const char * state_dir
resume state and scrobble log directory, NULL = none
Definition esp32.h:33
core_log_level_t log_level
Definition esp32.h:44
uint8_t task_priority
FreeRTOS priority of the audio task.
Definition esp32.h:40