#include <audio_pipeline.h>
Definition at line 60 of file audio_pipeline.h.
◆ AudioPipeline()
esphome::speaker::AudioPipeline::AudioPipeline |
( |
speaker::Speaker * |
speaker, |
|
|
size_t |
buffer_size, |
|
|
bool |
task_stack_in_psram, |
|
|
std::string |
base_name, |
|
|
UBaseType_t |
priority |
|
) |
| |
- Parameters
-
speaker | ESPHome speaker component for pipeline's audio output |
buffer_size | Size of the buffer in bytes between the reader and decoder |
task_stack_in_psram | True if the task stack should be allocated in PSRAM, false otherwise |
task_name | FreeRTOS task base name |
priority | FreeRTOS task priority |
Definition at line 46 of file audio_pipeline.cpp.
◆ allocate_communications_()
esp_err_t esphome::speaker::AudioPipeline::allocate_communications_ |
( |
| ) |
|
|
protected |
Allocates the event group and info error queue.
- Returns
- ESP_OK if successful or ESP_ERR_NO_MEM if it is unable to allocate all parts
Definition at line 230 of file audio_pipeline.cpp.
◆ decode_task()
void esphome::speaker::AudioPipeline::decode_task |
( |
void * |
params | ) |
|
|
staticprotected |
◆ delete_tasks_()
void esphome::speaker::AudioPipeline::delete_tasks_ |
( |
| ) |
|
|
protected |
Resets the task related pointers and deallocates their stacks.
Definition at line 303 of file audio_pipeline.cpp.
◆ get_playback_ms()
uint32_t esphome::speaker::AudioPipeline::get_playback_ms |
( |
| ) |
|
|
inline |
◆ process_state()
Processes the state of the audio pipeline based on the info_error_queue_ and event_group_.
Handles creating and stopping the pipeline tasks. Needs to be regularly called to update the internal pipeline state.
- Returns
- AudioPipelineState
Definition at line 102 of file audio_pipeline.cpp.
◆ read_task()
void esphome::speaker::AudioPipeline::read_task |
( |
void * |
params | ) |
|
|
staticprotected |
◆ resume_tasks()
void esphome::speaker::AudioPipeline::resume_tasks |
( |
| ) |
|
◆ set_pause_state()
void esphome::speaker::AudioPipeline::set_pause_state |
( |
bool |
pause_state | ) |
|
◆ start_file()
void esphome::speaker::AudioPipeline::start_file |
( |
audio::AudioFile * |
audio_file | ) |
|
Starts an audio pipeline given a AudioFile pointer.
- Parameters
-
audio_file | pointer to an AudioFile object |
- Returns
- ESP_OK if successful or an appropriate error if not
Definition at line 65 of file audio_pipeline.cpp.
◆ start_tasks_()
esp_err_t esphome::speaker::AudioPipeline::start_tasks_ |
( |
| ) |
|
|
protected |
Common start code for the pipeline, regardless if the source is a file or url.
- Returns
- ESP_OK if successful or an appropriate error if not
Definition at line 247 of file audio_pipeline.cpp.
◆ start_url()
void esphome::speaker::AudioPipeline::start_url |
( |
const std::string & |
uri | ) |
|
Starts an audio pipeline given a media url.
- Parameters
-
- Returns
- ESP_OK if successful or an appropriate error if not
Definition at line 57 of file audio_pipeline.cpp.
◆ stop()
esp_err_t esphome::speaker::AudioPipeline::stop |
( |
| ) |
|
Stops the pipeline.
Sends a stop signal to each task (if running) and clears the ring buffers.
- Returns
- ESP_OK if successful or ESP_ERR_TIMEOUT if the tasks did not indicate they stopped
Definition at line 73 of file audio_pipeline.cpp.
◆ suspend_tasks()
void esphome::speaker::AudioPipeline::suspend_tasks |
( |
| ) |
|
◆ base_name_
std::string esphome::speaker::AudioPipeline::base_name_ |
|
protected |
◆ buffer_size_
size_t esphome::speaker::AudioPipeline::buffer_size_ |
|
protected |
◆ current_audio_file_
audio::AudioFile* esphome::speaker::AudioPipeline::current_audio_file_ {nullptr} |
|
protected |
◆ current_audio_file_type_
◆ current_audio_stream_info_
◆ current_uri_
std::string esphome::speaker::AudioPipeline::current_uri_ {} |
|
protected |
◆ decode_task_handle_
TaskHandle_t esphome::speaker::AudioPipeline::decode_task_handle_ {nullptr} |
|
protected |
◆ decode_task_stack_
StaticTask_t esphome::speaker::AudioPipeline::decode_task_stack_ |
|
protected |
◆ decode_task_stack_buffer_
StackType_t* esphome::speaker::AudioPipeline::decode_task_stack_buffer_ {nullptr} |
|
protected |
◆ event_group_
EventGroupHandle_t esphome::speaker::AudioPipeline::event_group_ {nullptr} |
|
protected |
◆ hard_stop_
bool esphome::speaker::AudioPipeline::hard_stop_ {false} |
|
protected |
◆ info_error_queue_
QueueHandle_t esphome::speaker::AudioPipeline::info_error_queue_ {nullptr} |
|
protected |
◆ is_playing_
bool esphome::speaker::AudioPipeline::is_playing_ {false} |
|
protected |
◆ pause_state_
bool esphome::speaker::AudioPipeline::pause_state_ {false} |
|
protected |
◆ pending_file_
bool esphome::speaker::AudioPipeline::pending_file_ {false} |
|
protected |
◆ pending_url_
bool esphome::speaker::AudioPipeline::pending_url_ {false} |
|
protected |
◆ playback_ms_
uint32_t esphome::speaker::AudioPipeline::playback_ms_ {0} |
|
protected |
◆ priority_
UBaseType_t esphome::speaker::AudioPipeline::priority_ |
|
protected |
◆ raw_file_ring_buffer_
std::weak_ptr<RingBuffer> esphome::speaker::AudioPipeline::raw_file_ring_buffer_ |
|
protected |
◆ read_task_handle_
TaskHandle_t esphome::speaker::AudioPipeline::read_task_handle_ {nullptr} |
|
protected |
◆ read_task_stack_
StaticTask_t esphome::speaker::AudioPipeline::read_task_stack_ |
|
protected |
◆ read_task_stack_buffer_
StackType_t* esphome::speaker::AudioPipeline::read_task_stack_buffer_ {nullptr} |
|
protected |
◆ speaker_
◆ task_stack_in_psram_
bool esphome::speaker::AudioPipeline::task_stack_in_psram_ |
|
protected |
◆ transfer_buffer_size_
size_t esphome::speaker::AudioPipeline::transfer_buffer_size_ |
|
protected |
The documentation for this class was generated from the following files: