mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-19 18:38:09 +00:00
refactor: Delay audio success sound playback until after activation completion
- Moved the success sound playback to a scheduled task to ensure it occurs after the activation process is complete. - This change improves the responsiveness of the application during activation events.
This commit is contained in:
@@ -309,13 +309,15 @@ void Application::HandleActivationDoneEvent() {
|
||||
display->ShowNotification(message.c_str());
|
||||
display->SetChatMessage("system", "");
|
||||
|
||||
// Play the success sound to indicate the device is ready
|
||||
audio_service_.PlaySound(Lang::Sounds::OGG_SUCCESS);
|
||||
|
||||
// Release OTA object after activation is complete
|
||||
ota_.reset();
|
||||
auto& board = Board::GetInstance();
|
||||
board.SetPowerSaveLevel(PowerSaveLevel::LOW_POWER);
|
||||
|
||||
Schedule([this]() {
|
||||
// Play the success sound to indicate the device is ready
|
||||
audio_service_.PlaySound(Lang::Sounds::OGG_SUCCESS);
|
||||
});
|
||||
}
|
||||
|
||||
void Application::ActivationTask() {
|
||||
|
||||
Reference in New Issue
Block a user