From 175f00f41bc8305cfa65bef7142ba7cdd4ee8140 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:28:24 +1300 Subject: [PATCH] Fix write_speaker without speaker in config (#5847) --- esphome/components/voice_assistant/voice_assistant.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/voice_assistant/voice_assistant.cpp b/esphome/components/voice_assistant/voice_assistant.cpp index c0e706305d..29fc664342 100644 --- a/esphome/components/voice_assistant/voice_assistant.cpp +++ b/esphome/components/voice_assistant/voice_assistant.cpp @@ -344,6 +344,7 @@ void VoiceAssistant::loop() { } } +#ifdef USE_SPEAKER void VoiceAssistant::write_speaker_() { if (this->speaker_buffer_size_ > 0) { size_t written = this->speaker_->play(this->speaker_buffer_, this->speaker_buffer_size_); @@ -357,6 +358,7 @@ void VoiceAssistant::write_speaker_() { } } } +#endif void VoiceAssistant::client_subscription(api::APIConnection *client, bool subscribe) { if (!subscribe) {