1. 完成了语音识别的C++业务层封装,测试通过

2. 试着测试了一下LVGL_GIF渲染+音乐播放+语音识别的组合简单优化后,
          发现lvgl渲染略显卡顿,语音识别有缓冲区空警告,不过无伤大雅,还需要进一步深度优化。
This commit is contained in:
Misaki
2025-09-16 01:29:17 +08:00
parent dc420c3b7a
commit 4cc761aab3
26 changed files with 134775 additions and 32 deletions
+45 -2
View File
@@ -6,7 +6,6 @@
#include "PetBaseClass.h"
#include "SDFileManager.h"
#include "cJSON.h"
#include <unordered_map>
#include <string>
// 辅助函数:枚举类型与字符串的转换
@@ -62,4 +61,48 @@ private:
// 宠物数据存储目录
static constexpr const char* PET_DATA_DIR = "/sdcard/pet_data";
};
};
/**
* 宠物数据结构(JSON)
{
"name": "芝士雪豹",
"hp": 85,
"density": 120,
"identity": "我是顶真,是妈妈省的",
"stage_strategy": {
"current_stage": "PET_STAGE_ADULT",
"stage_model_map": {
"PET_STAGE_YOUNG": "/models/snow_leopard_young.gif",
"PET_STAGE_ADULT": "/models/snow_leopard_adult.gif",
"PET_STAGE_OLD": "/models/snow_leopard_old.gif"
},
"stage_audio_map": {
"PET_STAGE_YOUNG": "/audio/snow_leopard_young.mp3",
"PET_STAGE_ADULT": "/audio/snow_leopard_adult.mp3",
"PET_STAGE_OLD": "/audio/snow_leopard_old.mp3"
}
},
"action_strategy": {
"current_action": "PET_ACTION_SLEEP",
"action_model_map": {
"PET_ACTION_SLEEP": "/models/actions/sleep.gif",
"PET_ACTION_EAT": "/models/actions/eat.gif",
"PET_ACTION_HAPPY": "/models/actions/happy.gif",
"PET_ACTION_ANGRY": "/models/actions/angry.gif",
"PET_ACTION_SAD": "/models/actions/sad.gif",
"PET_ACTION_EVOLVE": "/models/actions/evolve.gif",
"PET_ACTION_TOUCH": "/models/actions/touch.gif"
},
"action_audio_map": {
"PET_ACTION_SLEEP": "/audio/actions/sleep.mp3",
"PET_ACTION_EAT": "/audio/actions/eat.mp3",
"PET_ACTION_HAPPY": "/audio/actions/happy.mp3",
"PET_ACTION_ANGRY": "/audio/actions/angry.mp3",
"PET_ACTION_SAD": "/audio/actions/sad.mp3",
"PET_ACTION_EVOLVE": "/audio/actions/evolve.mp3",
"PET_ACTION_TOUCH": "/audio/actions/touch.mp3"
}
}
}
*/