feat: 开放小爱音箱接入小智 AI 演示源代码

This commit is contained in:
Del Wang
2025-04-09 21:10:42 +08:00
parent d170fadbcc
commit 6237c46441
25 changed files with 3983 additions and 0 deletions
@@ -0,0 +1,30 @@
class ListeningMode:
"""监听模式"""
ALWAYS_ON = "always_on"
AUTO_STOP = "auto_stop"
MANUAL = "manual"
class AbortReason:
"""中止原因"""
NONE = "none"
WAKE_WORD_DETECTED = "wake_word_detected"
class DeviceState:
"""设备状态"""
IDLE = "idle"
CONNECTING = "connecting"
LISTENING = "listening"
SPEAKING = "speaking"
class EventType:
"""事件类型"""
SCHEDULE_EVENT = "schedule_event"
AUDIO_INPUT_READY_EVENT = "audio_input_ready_event"
AUDIO_OUTPUT_READY_EVENT = "audio_output_ready_event"
class AudioConfig:
"""音频配置"""
SAMPLE_RATE = 24000
CHANNELS = 1
FRAME_DURATION = 60 # ms
FRAME_SIZE = int(SAMPLE_RATE * (FRAME_DURATION / 1000))