ESPHome
2025.2.0
|
#include <resampler_speaker.h>
Public Member Functions | |
float | get_setup_priority () const override |
void | setup () override |
void | loop () override |
size_t | play (const uint8_t *data, size_t length, TickType_t ticks_to_wait) override |
size_t | play (const uint8_t *data, size_t length) override |
void | start () override |
void | stop () override |
void | finish () override |
void | set_pause_state (bool pause_state) override |
bool | get_pause_state () const override |
bool | has_buffered_data () const override |
void | set_mute_state (bool mute_state) override |
Mute state changes are passed to the parent's output speaker. More... | |
void | set_volume (float volume) override |
Volume state changes are passed to the parent's output speaker. More... | |
void | set_output_speaker (speaker::Speaker *speaker) |
void | set_task_stack_in_psram (bool task_stack_in_psram) |
void | set_target_bits_per_sample (uint8_t target_bits_per_sample) |
void | set_target_sample_rate (uint32_t target_sample_rate) |
void | set_filters (uint16_t filters) |
void | set_taps (uint16_t taps) |
void | set_buffer_duration (uint32_t buffer_duration_ms) |
![]() | |
virtual void | dump_config () |
float | get_actual_setup_priority () const |
void | set_setup_priority (float priority) |
virtual float | get_loop_priority () const |
priority of loop(). More... | |
void | call () |
virtual void | on_shutdown () |
virtual void | on_safe_shutdown () |
uint32_t | get_component_state () const |
virtual void | mark_failed () |
Mark this component as failed. More... | |
bool | is_failed () const |
bool | is_ready () const |
virtual bool | can_proceed () |
bool | status_has_warning () const |
bool | status_has_error () const |
void | status_set_warning (const char *message="unspecified") |
void | status_set_error (const char *message="unspecified") |
void | status_clear_warning () |
void | status_clear_error () |
void | status_momentary_warning (const std::string &name, uint32_t length=5000) |
void | status_momentary_error (const std::string &name, uint32_t length=5000) |
bool | has_overridden_loop () const |
void | set_component_source (const char *source) |
Set where this component was loaded from for some debug messages. More... | |
const char * | get_component_source () const |
Get the integration where this component was declared as a string. More... | |
![]() | |
size_t | play (const std::vector< uint8_t > &data) |
bool | is_running () const |
bool | is_stopped () const |
float | get_volume () |
bool | get_mute_state () |
void | set_audio_dac (audio_dac::AudioDac *audio_dac) |
void | set_audio_stream_info (const audio::AudioStreamInfo &audio_stream_info) |
audio::AudioStreamInfo & | get_audio_stream_info () |
void | add_audio_output_callback (std::function< void(uint32_t, uint32_t, uint32_t, uint32_t)> &&callback) |
Callback function for sending the duration of the audio written to the speaker since the last callback. More... | |
Protected Member Functions | |
esp_err_t | start_ () |
Starts the output speaker after setting the resampled stream info. More... | |
esp_err_t | start_task_ () |
Starts the resampler task after allocating the task stack. More... | |
void | stop_ () |
Stops the output speaker. If the resampling task is running, it sends the stop command. More... | |
esp_err_t | delete_task_ () |
Deallocates the task stack and resets the pointers. More... | |
bool | requires_resampling_ () const |
![]() | |
virtual void | call_loop () |
virtual void | call_setup () |
virtual void | call_dump_config () |
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
Set an interval function with a unique name. More... | |
void | set_interval (uint32_t interval, std::function< void()> &&f) |
bool | cancel_interval (const std::string &name) |
Cancel an interval function. More... | |
void | set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
Set an retry function with a unique name. More... | |
void | set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
bool | cancel_retry (const std::string &name) |
Cancel a retry function. More... | |
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a unique name. More... | |
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
bool | cancel_timeout (const std::string &name) |
Cancel a timeout function. More... | |
void | defer (const std::string &name, std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
void | defer (std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
bool | cancel_defer (const std::string &name) |
Cancel a defer callback using the specified name, name must not be empty. More... | |
Static Protected Member Functions | |
static void | resample_task (void *params) |
Definition at line 17 of file resampler_speaker.h.
|
protected |
Deallocates the task stack and resets the pointers.
Definition at line 203 of file resampler_speaker.cpp.
|
overridevirtual |
Reimplemented from esphome::speaker::Speaker.
Definition at line 225 of file resampler_speaker.cpp.
|
inlineoverridevirtual |
Reimplemented from esphome::speaker::Speaker.
Definition at line 31 of file resampler_speaker.h.
|
inlineoverridevirtual |
Reimplemented from esphome::Component.
Definition at line 19 of file resampler_speaker.h.
|
overridevirtual |
Implements esphome::speaker::Speaker.
Definition at line 227 of file resampler_speaker.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 55 of file resampler_speaker.cpp.
|
overridevirtual |
Reimplemented from esphome::speaker::Speaker.
Definition at line 132 of file resampler_speaker.cpp.
|
inlineoverridevirtual |
Implements esphome::speaker::Speaker.
Definition at line 24 of file resampler_speaker.h.
|
inlineprotected |
Definition at line 245 of file resampler_speaker.cpp.
|
staticprotected |
Definition at line 250 of file resampler_speaker.cpp.
|
inline |
Definition at line 52 of file resampler_speaker.h.
|
inline |
Definition at line 49 of file resampler_speaker.h.
|
overridevirtual |
Mute state changes are passed to the parent's output speaker.
Reimplemented from esphome::speaker::Speaker.
Definition at line 235 of file resampler_speaker.cpp.
|
inline |
Definition at line 41 of file resampler_speaker.h.
|
inlineoverridevirtual |
Reimplemented from esphome::speaker::Speaker.
Definition at line 30 of file resampler_speaker.h.
|
inline |
Definition at line 50 of file resampler_speaker.h.
|
inline |
Definition at line 44 of file resampler_speaker.h.
|
inline |
Definition at line 47 of file resampler_speaker.h.
|
inline |
Definition at line 42 of file resampler_speaker.h.
|
overridevirtual |
Volume state changes are passed to the parent's output speaker.
Reimplemented from esphome::speaker::Speaker.
Definition at line 240 of file resampler_speaker.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 37 of file resampler_speaker.cpp.
|
overridevirtual |
Implements esphome::speaker::Speaker.
Definition at line 150 of file resampler_speaker.cpp.
|
protected |
Starts the output speaker after setting the resampled stream info.
If resampling is required, it starts the task.
Definition at line 152 of file resampler_speaker.cpp.
|
protected |
Starts the resampler task after allocating the task stack.
Definition at line 167 of file resampler_speaker.cpp.
|
overridevirtual |
Implements esphome::speaker::Speaker.
Definition at line 194 of file resampler_speaker.cpp.
|
protected |
Stops the output speaker. If the resampling task is running, it sends the stop command.
Definition at line 196 of file resampler_speaker.cpp.
|
protected |
Definition at line 99 of file resampler_speaker.h.
|
protected |
Definition at line 78 of file resampler_speaker.h.
|
protected |
Definition at line 94 of file resampler_speaker.h.
|
protected |
Definition at line 82 of file resampler_speaker.h.
|
protected |
Definition at line 101 of file resampler_speaker.h.
|
protected |
Definition at line 80 of file resampler_speaker.h.
|
protected |
Definition at line 93 of file resampler_speaker.h.
|
protected |
Definition at line 96 of file resampler_speaker.h.
|
protected |
Definition at line 97 of file resampler_speaker.h.
|
protected |
Definition at line 91 of file resampler_speaker.h.
|
protected |
Definition at line 85 of file resampler_speaker.h.
|
protected |
Definition at line 87 of file resampler_speaker.h.
|
protected |
Definition at line 88 of file resampler_speaker.h.
|
protected |
Definition at line 89 of file resampler_speaker.h.
|
protected |
Definition at line 84 of file resampler_speaker.h.