From 218d0318feddcec6b73145920854480820675adb Mon Sep 17 00:00:00 2001 From: Terrence Date: Fri, 6 Jun 2025 21:39:22 +0800 Subject: [PATCH] fix audio debugger compiling errors --- main/audio_processing/audio_debugger.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/audio_processing/audio_debugger.cc b/main/audio_processing/audio_debugger.cc index 216b2258..630057cf 100644 --- a/main/audio_processing/audio_debugger.cc +++ b/main/audio_processing/audio_debugger.cc @@ -43,13 +43,16 @@ AudioDebugger::AudioDebugger() { } AudioDebugger::~AudioDebugger() { +#if CONFIG_USE_AUDIO_DEBUGGER if (udp_sockfd_ >= 0) { close(udp_sockfd_); ESP_LOGI(TAG, "Closed UDP socket"); } +#endif } void AudioDebugger::Feed(const std::vector& data) { +#if CONFIG_USE_AUDIO_DEBUGGER if (udp_sockfd_ >= 0) { ssize_t sent = sendto(udp_sockfd_, data.data(), data.size() * sizeof(int16_t), 0, (struct sockaddr*)&udp_server_addr_, sizeof(udp_server_addr_)); @@ -59,6 +62,7 @@ void AudioDebugger::Feed(const std::vector& data) { ESP_LOGD(TAG, "Sent %d bytes audio data to %s", sent, CONFIG_AUDIO_DEBUG_UDP_SERVER); } } +#endif } \ No newline at end of file