Baji_Rtc_Toy/main/dzbj/ai_chat_ui.h
Rdzleo 919bf8f28f feat: GIF动画表情系统 + 情绪映射增强 + HTTPS音频中止修复
一、新增功能:
1、新增8种GIF动画表情(200x89) + 3种叠加图标(45x45),实现22种情绪标签到GIF的映射表;
2、新增30+组英文近义词情绪fallback映射(如worried→sad),防止AI使用非标准标签时GIF无法切换;
3、新增HTTPS中止后诊断日志,自动追踪前20帧音频处理流程便于定位无声问题;

二、Bug修复:
4、修复HTTPS播放中止后RTC音频解码参数未恢复(16000/60→8000/20),通过background_task_串行化恢复;
5、修复AbortHttpsPlayback解码器竞态崩溃,将重置/恢复/DMA flush全部串行化执行;
6、修复LVGL gifdec不支持无全局颜色表GIF的问题,支持仅使用局部颜色表的压缩GIF;
7、修复GIF透明区域显示黑色方块,canvas初始alpha改为0x00;
8、修复lv_gif定时器gif对象为NULL时的空指针崩溃;

三、优化:
9、情绪标签从等待is_final改为第一条字幕即时触发GIF切换,新增去重和回复结束自动恢复neutral;
10、对话状态表情映射优化:THINKING→thinking、ANSWERING→happy、INTERRUPTED→surprised;
11、CPU核心绑定:LVGL任务Core0,音频循环Core1,避免GIF解码与音频争抢;
12、中文情绪词映射扩展,新增担心/心疼/着急等映射;

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 15:28:14 +08:00

29 lines
632 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _AI_CHAT_UI_H_
#define _AI_CHAT_UI_H_
#ifdef __cplusplus
extern "C" {
#endif
// 创建并加载 AI 对话屏幕
void ai_chat_screen_init(void);
// 更新状态文本(如 "Listening...", "Speaking..."
void ai_chat_set_status(const char* status);
// 更新情绪指示(改变指示圆点颜色)
void ai_chat_set_emotion(const char* emotion);
// 更新聊天消息(预留接口)
void ai_chat_set_chat_message(const char* role, const char* content);
// 恢复 GIF 动画播放(开机音频播放完成后调用)
void ai_chat_resume_animation(void);
#ifdef __cplusplus
}
#endif
#endif // _AI_CHAT_UI_H_