14#include <freertos/FreeRTOS.h>
15#include <freertos/event_groups.h>
16#include <freertos/queue.h>
22static const size_t DEFAULT_TRANSFER_BUFFER_SIZE = 24 * 1024;
static void read_task(void *params)
void suspend_tasks()
Suspends any running tasks.
speaker::Speaker * speaker_
void set_pause_state(bool pause_state)
void delete_tasks_()
Resets the task related pointers and deallocates their stacks.
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_
StackType_t * decode_task_stack_buffer_
void start_file(audio::AudioFile *audio_file)
Starts an audio pipeline given a AudioFile pointer.
TaskHandle_t decode_task_handle_
esp_err_t stop()
Stops the pipeline.
uint32_t get_playback_ms()
StaticTask_t decode_task_stack_
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_
StaticTask_t read_task_stack_
bool task_stack_in_psram_
size_t transfer_buffer_size_
TaskHandle_t read_task_handle_
QueueHandle_t info_error_queue_
audio::AudioFileType current_audio_file_type_
StackType_t * read_task_stack_buffer_
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