feat(voice): add on-device Miao Zhang Gui wake word

Add an optional local wake response prompt configuration. The prompt asset is intentionally not included yet.
This commit is contained in:
chenjintao
2026-08-10 16:54:42 +08:00
parent d9660164a6
commit e5c1564130
21 changed files with 2010 additions and 56 deletions
+42
View File
@@ -66,6 +66,34 @@ typedef esp_err_t (*domain_multimodal_audio_uplink_cb_t)(
size_t len,
void *user_data);
typedef enum {
DOMAIN_LOCAL_COMMAND_MIAO_ZHANG_GUI = 1,
} domain_local_command_id_t;
typedef enum {
DOMAIN_LOCAL_COMMAND_EVENT_DETECTED = 0,
} domain_local_command_event_type_t;
typedef struct {
domain_local_command_event_type_t type;
domain_local_command_id_t command_id;
uint32_t confidence_x10000;
uint32_t detection_generation;
} domain_local_command_event_t;
typedef void (*domain_local_command_event_callback_t)(
const domain_local_command_event_t *event,
void *user_data);
typedef struct {
bool started;
bool detection_running;
uint32_t detection_generation;
uint32_t detection_count;
uint32_t dropped_pcm_frames;
uint32_t task_stack_high_water_bytes;
} domain_local_command_snapshot_t;
typedef enum {
DOMAIN_MULTIMODAL_DOWNSTREAM_PLAYBACK_STARTED = 0,
DOMAIN_MULTIMODAL_DOWNSTREAM_PLAYBACK_COMPLETED,
@@ -180,6 +208,20 @@ esp_err_t domain_runtime_multimodal_audio_start_uplink(
esp_err_t domain_runtime_multimodal_audio_stop_uplink(int timeout_ms);
bool domain_runtime_multimodal_audio_is_uplink_running(void);
bool domain_runtime_multimodal_audio_is_initialized(void);
/**
* @brief Start local MultiNet detection for the Chinese phrase "喵掌柜".
*
* The callback runs in the domain inference task and must be bounded and
* non-blocking. Repeated start with the same callback is idempotent.
*/
esp_err_t domain_runtime_local_command_start(
domain_local_command_event_callback_t callback,
void *user_data);
esp_err_t domain_runtime_local_command_suspend(int timeout_ms);
esp_err_t domain_runtime_local_command_resume(int timeout_ms);
esp_err_t domain_runtime_local_command_stop(int timeout_ms);
esp_err_t domain_runtime_local_command_get_snapshot(
domain_local_command_snapshot_t *out_snapshot);
esp_err_t domain_runtime_multimodal_audio_play_downstream_opus(const uint8_t *data, size_t len);
esp_err_t domain_runtime_multimodal_audio_begin_downstream_response(void);
esp_err_t domain_runtime_multimodal_audio_finish_downstream_response(void);