forked from xiaozhi/xiaozhi-esp32
feat: add emote style for v2 (#1217)
* feat: add emote style for v2 * feat: delete asset probe apply
This commit is contained in:
@@ -4,7 +4,12 @@
|
||||
{
|
||||
"name": "esp-box-3",
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_USE_DEVICE_AEC=y"
|
||||
"CONFIG_USE_DEVICE_AEC=y",
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v2/16m.csv\"",
|
||||
"CONFIG_USE_EMOTE_MESSAGE_STYLE=y",
|
||||
"CONFIG_BOARD_TYPE_ESP_BOX_3=y",
|
||||
"CONFIG_FLASH_CUSTOM_ASSETS=y",
|
||||
"CONFIG_CUSTOM_ASSETS_FILE=\"https://dl.espressif.com/AE/wn9_nihaoxiaozhi_tts-font_puhui_common_20_4-esp-box-3.bin\""
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
22
main/boards/esp-box-3/emote.json
Normal file
22
main/boards/esp-box-3/emote.json
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{"emote": "happy", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "laughing", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "funny", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "loving", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "embarrassed", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "confident", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "delicious", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "sad", "src": "Sad.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "crying", "src": "cry.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "sleepy", "src": "sleep.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "silly", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "angry", "src": "angry.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "surprised", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "shocked", "src": "shocked.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "thinking", "src": "confused.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "winking", "src": "neutral.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "relaxed", "src": "Happy.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "confused", "src": "confused.eaf", "loop": true, "fps": 20},
|
||||
{"emote": "neutral", "src": "winking.eaf", "loop": false, "fps": 20},
|
||||
{"emote": "idle", "src": "neutral.eaf", "loop": false, "fps": 20}
|
||||
]
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "wifi_board.h"
|
||||
#include "codecs/box_audio_codec.h"
|
||||
#include "display/display.h"
|
||||
#include "display/emote_display.h"
|
||||
#include "display/lcd_display.h"
|
||||
#include "esp_lcd_ili9341.h"
|
||||
#include "application.h"
|
||||
@@ -39,7 +41,7 @@ class EspBox3Board : public WifiBoard {
|
||||
private:
|
||||
i2c_master_bus_handle_t i2c_bus_;
|
||||
Button boot_button_;
|
||||
LcdDisplay* display_;
|
||||
Display* display_;
|
||||
|
||||
void InitializeI2c() {
|
||||
// Initialize I2C peripheral
|
||||
@@ -125,8 +127,13 @@ private:
|
||||
esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY);
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
esp_lcd_panel_disp_on_off(panel, true);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
|
||||
|
||||
#if CONFIG_USE_EMOTE_MESSAGE_STYLE
|
||||
display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT);
|
||||
#else
|
||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
37
main/boards/esp-box-3/layout.json
Normal file
37
main/boards/esp-box-3/layout.json
Normal file
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
"name": "eye_anim",
|
||||
"align": "GFX_ALIGN_LEFT_MID",
|
||||
"x": 10,
|
||||
"y": 30
|
||||
},
|
||||
{
|
||||
"name": "status_icon",
|
||||
"align": "GFX_ALIGN_TOP_MID",
|
||||
"x": -120,
|
||||
"y": 18
|
||||
},
|
||||
{
|
||||
"name": "toast_label",
|
||||
"align": "GFX_ALIGN_TOP_MID",
|
||||
"x": 0,
|
||||
"y": 20,
|
||||
"width": 200,
|
||||
"height": 40
|
||||
},
|
||||
{
|
||||
"name": "clock_label",
|
||||
"align": "GFX_ALIGN_TOP_MID",
|
||||
"x": 0,
|
||||
"y": 20,
|
||||
"width": 200,
|
||||
"height": 50
|
||||
},
|
||||
{
|
||||
"name": "listen_anim",
|
||||
"align": "GFX_ALIGN_TOP_MID",
|
||||
"x": 0,
|
||||
"y": 5
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user