mirror of
https://github.com/esphome/esphome.git
synced 2026-08-17 10:52:56 +08:00
[voice_assistant] Do not consume the audio chunk when the send is refused (#18295)
This commit is contained in:
@@ -249,7 +249,11 @@ void VoiceAssistant::stream_api_audio_() {
|
||||
}
|
||||
|
||||
if (!this->api_client_->send_message(msg)) {
|
||||
ESP_LOGV(TAG, "Audio frame dropped, TCP buffer full");
|
||||
// Keep the chunk exposed and retry next pass, the same shape as
|
||||
// APIConnection::try_send_camera_image_(): the slice is only lost if
|
||||
// the ring buffer overflows before the TCP buffer clears, instead of
|
||||
// on every refusal. The api layer already reports the refusal at V.
|
||||
return;
|
||||
}
|
||||
|
||||
this->audio_source_->consume(available);
|
||||
|
||||
Reference in New Issue
Block a user