Page 1 of 1

可以在源代码中修改喵伴设备各个状态下的表情吗?

Posted: Wed Aug 27, 2025 2:19 am
by keroro
如果可以的话,要怎么修改?现在已经有了各类表情的.mp4,大概每个2m左右,是否需要对.mp4进行转换?

Re: 可以在源代码中修改喵伴设备各个状态下的表情吗?

Posted: Thu Aug 28, 2025 2:59 am
by lzw655
你好,

表情 UI 绘制是基于 [image_player ](https://components.espressif.com/compon ... 1.1/readme) 组件绘制的,无需用到 lvgl,但是目前定制的灵活性上有一定限制,后续会更新更灵活的表情框架,可以先参考下面的步骤替换已有资源素材:

1. 要求:
  • 源文件为 GIF 格式。
  • 尺寸与工程里保持一致,emotion 为 `284x126`,icon 为 `64x64`。
  • 文件名和数量与工程里保持一致,仅对已有素材进行替换,而非增减。
2. 生成 .aaf 文件:参考 image_player [README](https://github.com/espressif2022/image_player#scripts) 通过 python 脚本将 GIF 源文件转换为 .aaf 文件,以如下为例:

Code: Select all

// emotion
python <brookesia_path>/products/speaker/managed_components/espressif2022__image_player/script/gif_to_aaf.py <brookesia_path>/core/brookesia_core/docs/_static/assets/animations/emotion <brookesia_path>/core/brookesia_core/systems/speaker/assets/animations/emotion --split 126 --depth 8

// icon
python <brookesia_path>/products/speaker/managed_components/espressif2022__image_player/script/gif_to_aaf.py <brookesia_path>/core/brookesia_core/docs/_static/assets/animations/icon <brookesia_path>/core/brookesia_core/systems/speaker/assets/animations/icon--split 64 --depth 8
3. 重新编译烧录即可