From 659c470eba542383987aad227b7f918100f131fa Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期五, 11 九月 2026 15:09:05 +0800
Subject: [PATCH] 小智终端 5种 场景模式 OK

---
 xiaozhi-esp32-2.2.6/main/audio/audio_service.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xiaozhi-esp32-2.2.6/main/audio/audio_service.h b/xiaozhi-esp32-2.2.6/main/audio/audio_service.h
index 3732ee4..3699578 100644
--- a/xiaozhi-esp32-2.2.6/main/audio/audio_service.h
+++ b/xiaozhi-esp32-2.2.6/main/audio/audio_service.h
@@ -117,12 +117,14 @@
     bool IsVoiceDetected() const { return voice_detected_; }
     bool IsIdle();
     void WaitForPlaybackQueueEmpty();
+    bool IsPlaybackQueueEmpty();
     bool IsWakeWordRunning() const { return xEventGroupGetBits(event_group_) & AS_EVENT_WAKE_WORD_RUNNING; }
     bool IsAudioProcessorRunning() const { return xEventGroupGetBits(event_group_) & AS_EVENT_AUDIO_PROCESSOR_RUNNING; }
     bool IsAfeWakeWord();
 
     void EnableWakeWordDetection(bool enable);
     void EnableVoiceProcessing(bool enable);
+    void EnsureVoiceProcessorReady();
     void EnableAudioTesting(bool enable);
     void EnableDeviceAec(bool enable);
 
@@ -133,6 +135,8 @@
     void PlaySound(const std::string_view& sound);
     bool ReadAudioData(std::vector<int16_t>& data, int sample_rate, int samples);
     void ResetDecoder();
+    void KeepCodecReadyForPlayback();
+    void SetAudioPowerInhibit(bool inhibit);
     void SetModelsList(srmodel_list_t* models_list);
 
 private:
@@ -180,6 +184,7 @@
     bool voice_detected_ = false;
     bool service_stopped_ = true;
     bool audio_input_need_warmup_ = false;
+    bool audio_power_inhibit_ = false;
 
     esp_timer_handle_t audio_power_timer_ = nullptr;
     std::chrono::steady_clock::time_point last_input_time_;

--
Gitblit v1.9.1