feat: add state change events and callbacks (#798)

This commit is contained in:
laride
2025-07-18 01:35:31 +08:00
committed by GitHub
parent c68c959e9b
commit 5c8707075f
7 changed files with 109 additions and 14 deletions

View File

@ -23,6 +23,7 @@
#include "audio_processor.h"
#include "wake_word.h"
#include "audio_debugger.h"
#include "device_state_event.h"
#define SCHEDULE_EVENT (1 << 0)
#define SEND_AUDIO_EVENT (1 << 1)
@ -34,20 +35,6 @@ enum AecMode {
kAecOnServerSide,
};
enum DeviceState {
kDeviceStateUnknown,
kDeviceStateStarting,
kDeviceStateWifiConfiguring,
kDeviceStateIdle,
kDeviceStateConnecting,
kDeviceStateListening,
kDeviceStateSpeaking,
kDeviceStateUpgrading,
kDeviceStateActivating,
kDeviceStateAudioTesting,
kDeviceStateFatalError
};
#define OPUS_FRAME_DURATION_MS 60
#define MAX_AUDIO_PACKETS_IN_QUEUE (2400 / OPUS_FRAME_DURATION_MS)
#define AUDIO_TESTING_MAX_DURATION_MS 10000