diff --git a/main/application.cc b/main/application.cc index 75452d69..c0ba33d7 100644 --- a/main/application.cc +++ b/main/application.cc @@ -85,7 +85,9 @@ void Application::CheckNewVersion() { wake_word_detect_.StopDetection(); #endif // 预先关闭音频输出,避免升级过程有音频操作 - board.GetAudioCodec()->EnableOutput(false); + auto codec = board.GetAudioCodec(); + codec->EnableInput(false); + codec->EnableOutput(false); { std::lock_guard lock(mutex_); audio_decode_queue_.clear(); @@ -479,7 +481,6 @@ void Application::ResetDecoder() { opus_decoder_->ResetState(); audio_decode_queue_.clear(); last_output_time_ = std::chrono::steady_clock::now(); - Board::GetInstance().GetAudioCodec()->EnableOutput(true); } void Application::OutputAudio() { @@ -598,8 +599,10 @@ void Application::SetDeviceState(DeviceState state) { // The state is changed, wait for all background tasks to finish background_task_->WaitForCompletion(); - auto display = Board::GetInstance().GetDisplay(); - auto led = Board::GetInstance().GetLed(); + auto& board = Board::GetInstance(); + auto codec = board.GetAudioCodec(); + auto display = board.GetDisplay(); + auto led = board.GetLed(); led->OnStateChanged(); switch (state) { case kDeviceStateUnknown: @@ -626,6 +629,7 @@ void Application::SetDeviceState(DeviceState state) { case kDeviceStateSpeaking: display->SetStatus("说话中..."); ResetDecoder(); + codec->EnableOutput(true); #if CONFIG_USE_AUDIO_PROCESSING audio_processor_.Stop(); #endif diff --git a/main/boards/xmini-c3/xmini_c3_board.cc b/main/boards/xmini-c3/xmini_c3_board.cc index 5332fce0..df072628 100644 --- a/main/boards/xmini-c3/xmini_c3_board.cc +++ b/main/boards/xmini-c3/xmini_c3_board.cc @@ -45,7 +45,6 @@ private: if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) { ResetWifiConfiguration(); } - app.ToggleChatState(); }); boot_button_.OnPressDown([this]() { Application::GetInstance().StartListening(); diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 719e9d44..3ad228f0 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -18,6 +18,7 @@ CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=n CONFIG_ESP_WIFI_IRAM_OPT=n CONFIG_ESP_WIFI_RX_IRAM_OPT=n