wangzhibo
2026-08-26 70481429367ca00144b24f118cbfdfb28b02967d
xiaozhi-esp32-2.2.6/main/audio/audio_service.cc
@@ -701,10 +701,10 @@
    models_list_ = models_list;
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32P4
    if (esp_srmodel_filter(models_list_, ESP_MN_PREFIX, NULL) != nullptr) {
        wake_word_ = std::make_unique<CustomWakeWord>();
    } else if (esp_srmodel_filter(models_list_, ESP_WN_PREFIX, NULL) != nullptr) {
    if (esp_srmodel_filter(models_list_, ESP_WN_PREFIX, NULL) != nullptr) {
        wake_word_ = std::make_unique<AfeWakeWord>();
    } else if (esp_srmodel_filter(models_list_, ESP_MN_PREFIX, NULL) != nullptr) {
        wake_word_ = std::make_unique<CustomWakeWord>();
    } else {
        wake_word_ = nullptr;
    }
@@ -722,6 +722,11 @@
                callbacks_.on_wake_word_detected(wake_word);
            }
        });
        wake_word_->OnOfflineCommandDetected([this](const std::string& command) {
            if (callbacks_.on_offline_command_detected) {
                callbacks_.on_offline_command_detected(command);
            }
        });
    }
}