usage of ESP_LOGD, renaming to has_stopped to is_stopped

This commit is contained in:
Mischa Siekmann 2024-05-13 01:04:33 +02:00
parent ceb61c873d
commit 4bd22e784f
3 changed files with 3 additions and 3 deletions

View File

@ -218,7 +218,7 @@ void I2SAudioSpeaker::loop() {
size_t I2SAudioSpeaker::play(const uint8_t *data, size_t length) {
if (this->state_ != speaker::STATE_RUNNING && this->state_ != speaker::STATE_STARTING) {
esph_log_d(TAG, "Called play while speaker not running.");
ESP_LOGD(TAG, "Called play while speaker not running.");
return 0;
}
size_t remaining = length;

View File

@ -23,7 +23,7 @@ class Speaker {
virtual bool has_buffered_data() const = 0;
bool is_running() const { return this->state_ == STATE_RUNNING; }
bool has_stopped() const { return this->state_ == STATE_STOPPED; }
bool is_stopped() const { return this->state_ == STATE_STOPPED; }
protected:
State state_{STATE_STOPPED};

View File

@ -340,7 +340,7 @@ void VoiceAssistant::loop() {
break;
} else if (this->speaker_->is_running()) {
this->speaker_->finish();
} else if (this->speaker_->has_stopped()) {
} else if (this->speaker_->is_stopped()) {
ESP_LOGD(TAG, "Speaker has finished outputting all audio");
this->cancel_timeout("speaker-timeout");
this->cancel_timeout("playing");