15#include <freertos/event_groups.h>
16#include <freertos/queue.h>
22static const size_t DEFAULT_TRANSFER_BUFFER_SIZE = 24 * 1024;
54 optional<esp_err_t>
err;
Helper for FreeRTOS static task management.
static void read_task(void *params)
void suspend_tasks()
Suspends any running tasks.
speaker::Speaker * speaker_
void set_pause_state(bool pause_state)
std::weak_ptr< RingBuffer > raw_file_ring_buffer_
void start_url(const std::string &uri)
Starts an audio pipeline given a media url.
esp_err_t allocate_communications_()
Allocates the event group and info error queue.
esp_err_t start_tasks_()
Common start code for the pipeline, regardless if the source is a file or url.
audio::AudioStreamInfo current_audio_stream_info_
void start_file(audio::AudioFile *audio_file)
Starts an audio pipeline given a AudioFile pointer.
esp_err_t stop()
Stops the pipeline.
uint32_t get_playback_ms()
static void decode_task(void *params)
AudioPipeline(speaker::Speaker *speaker, size_t buffer_size, bool task_stack_in_psram, std::string base_name, UBaseType_t priority)
void resume_tasks()
Resumes any running tasks.
EventGroupHandle_t event_group_
audio::AudioFile * current_audio_file_
bool task_stack_in_psram_
size_t transfer_buffer_size_
QueueHandle_t info_error_queue_
audio::AudioFileType current_audio_file_type_
AudioPipelineState process_state()
Processes the state of the audio pipeline based on the info_error_queue_ and event_group_.
@ INCOMPATIBLE_BITS_PER_SAMPLE
Providing packet encoding functions for exchanging data with a remote host.
optional< DecodingError > decoding_err
optional< esp_err_t > err
optional< audio::AudioFileType > file_type
optional< audio::AudioStreamInfo > audio_stream_info