40 lines
1.0 KiB
C
40 lines
1.0 KiB
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
typedef enum {
|
|
VOICE_DIALOG_STATE_IDLE = 0,
|
|
VOICE_DIALOG_STATE_LISTENING,
|
|
VOICE_DIALOG_STATE_THINKING,
|
|
VOICE_DIALOG_STATE_RESPONDING,
|
|
} voice_dialog_state_t;
|
|
|
|
typedef struct {
|
|
bool ready;
|
|
bool session_active;
|
|
bool ws_connected;
|
|
bool started;
|
|
bool tap_active;
|
|
voice_dialog_state_t dialog_state;
|
|
char task_id[40];
|
|
char dialog_id[40];
|
|
char last_error[128];
|
|
int64_t last_event_ms;
|
|
uint32_t upstream_packets;
|
|
uint32_t downstream_packets;
|
|
} voice_interaction_status_t;
|
|
|
|
esp_err_t voice_interaction_init(void);
|
|
esp_err_t voice_interaction_start(char *err, size_t err_len);
|
|
esp_err_t voice_interaction_stop(char *err, size_t err_len);
|
|
|
|
esp_err_t voice_interaction_tap_start(char *err, size_t err_len);
|
|
esp_err_t voice_interaction_tap_cancel(char *err, size_t err_len);
|
|
|
|
void voice_interaction_get_status(voice_interaction_status_t *out_status);
|
|
const char *voice_interaction_dialog_state_str(voice_dialog_state_t state);
|