mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 17:05:21 +01:00
More voice assistant fixes (#5547)
This commit is contained in:
parent
fd7d3c4332
commit
1f02096edb
2 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,8 @@ void I2SAudioMicrophone::setup() {
|
||||||
void I2SAudioMicrophone::start() {
|
void I2SAudioMicrophone::start() {
|
||||||
if (this->is_failed())
|
if (this->is_failed())
|
||||||
return;
|
return;
|
||||||
|
if (this->state_ == microphone::STATE_RUNNING)
|
||||||
|
return; // Already running
|
||||||
this->state_ = microphone::STATE_STARTING;
|
this->state_ = microphone::STATE_STARTING;
|
||||||
}
|
}
|
||||||
void I2SAudioMicrophone::start_() {
|
void I2SAudioMicrophone::start_() {
|
||||||
|
|
|
@ -287,6 +287,7 @@ void VoiceAssistant::loop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->wait_for_stream_end_) {
|
if (this->wait_for_stream_end_) {
|
||||||
|
this->cancel_timeout("playing");
|
||||||
break; // We dont want to timeout here as the STREAM_END event will take care of that.
|
break; // We dont want to timeout here as the STREAM_END event will take care of that.
|
||||||
}
|
}
|
||||||
playing = this->speaker_->is_running();
|
playing = this->speaker_->is_running();
|
||||||
|
|
Loading…
Reference in a new issue