11#include <freertos/FreeRTOS.h>
12#include <freertos/event_groups.h>
21 void setup()
override;
24 size_t play(
const uint8_t *data,
size_t length, TickType_t ticks_to_wait)
override;
27 void start()
override;
81 void send_command_(uint32_t command_bit,
bool wake_loop =
false);
void set_start_error_(esp_err_t err)
Sets the appropriate status error based on the start failure reason.
void set_volume(float volume) override
Volume state changes are passed to the parent's output speaker.
void set_target_sample_rate(uint32_t target_sample_rate)
void set_pause_state(bool pause_state) override
void set_target_bits_per_sample(uint8_t target_bits_per_sample)
std::weak_ptr< RingBuffer > ring_buffer_
size_t play(const uint8_t *data, size_t length) override
bool requires_resampling_() const
audio::AudioStreamInfo target_stream_info_
void set_output_speaker(speaker::Speaker *speaker)
uint32_t buffer_duration_ms_
bool task_stack_in_psram_
void set_buffer_duration(uint32_t buffer_duration_ms)
esp_err_t start_()
Starts the output speaker after setting the resampled stream info.
uint8_t target_bits_per_sample_
bool get_pause_state() const override
size_t play(const uint8_t *data, size_t length, TickType_t ticks_to_wait) override
void set_taps(uint16_t taps)
TaskHandle_t task_handle_
float get_setup_priority() const override
void set_task_stack_in_psram(bool task_stack_in_psram)
void enter_stopping_state_()
Transitions to STATE_STOPPING, records the stopping timestamp, sends the task stop command if the tas...
float get_volume() override
speaker::Speaker * output_speaker_
void dump_config() override
StackType_t * task_stack_buffer_
bool has_buffered_data() const override
void set_filters(uint16_t filters)
void delete_task_()
Deletes the resampler task if suspended, deallocates the task stack, and resets the related pointers.
void send_command_(uint32_t command_bit, bool wake_loop=false)
Sends a command via event group bits, enables the loop, and optionally wakes the main loop.
EventGroupHandle_t event_group_
uint64_t callback_remainder_
esp_err_t start_task_()
Starts the resampler task after allocating the task stack.
bool get_mute_state() override
uint32_t target_sample_rate_
static void resample_task(void *params)
void set_mute_state(bool mute_state) override
Mute state changes are passed to the parent's output speaker.
virtual float get_volume()
virtual bool get_pause_state() const
virtual void set_pause_state(bool pause_state)
virtual bool get_mute_state()
const float DATA
For components that import data from directly connected sensors like DHT.
Providing packet encoding functions for exchanging data with a remote host.