diff --git a/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp b/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp index 856507ec2b..ca616a21a6 100644 --- a/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp +++ b/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp @@ -266,6 +266,8 @@ size_t ESPADFSpeaker::play(const uint8_t *data, size_t length) { return index; } +bool ESPADFSpeaker::has_buffered_data() const { return uxQueueMessagesWaiting(this->buffer_queue_) > 0; } + } // namespace esp_adf } // namespace esphome diff --git a/esphome/components/esp_adf/speaker/esp_adf_speaker.h b/esphome/components/esp_adf/speaker/esp_adf_speaker.h index 2b3c151c79..d6729970c1 100644 --- a/esphome/components/esp_adf/speaker/esp_adf_speaker.h +++ b/esphome/components/esp_adf/speaker/esp_adf_speaker.h @@ -29,6 +29,8 @@ class ESPADFSpeaker : public ESPADFPipeline, public speaker::Speaker, public Com size_t play(const uint8_t *data, size_t length) override; + bool has_buffered_data() const override; + protected: void start_(); void watch_();