Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box-3 LVGL9 UI Demo #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/Box-3_LVGL9_Demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(Box-3_LVGL9_Demo)
21 changes: 21 additions & 0 deletions examples/Box-3_LVGL9_Demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ESP32 Text-to-Speech (PicoTTS) with LVGL UI

This project demonstrates how to implement PicoTTS system on an ESP32 device using the PicoTTS engine and LVGL for graphical user interface (GUI). The TTS system speaks predefined text when interacting with buttons in a tabbed UI.


## How It Works

* The project starts with a predefined greeting, "Hello. Welcome back to my project. This is Eric!".

* The main UI is composed of two tabs:
* Greetings Tab: Contains a list of buttons, each with a predefined greeting. When a button is clicked, the corresponding text is spoken via the TTS engine.
* E-Book Style Tab: Contains a longer text, and a floating button at the bottom triggers the TTS system to read the long sentence.
* The audio output is handled by the ESP32’s codec, and the TTS engine converts the text into speech using the triggerTTS function.

## Hardware

* [ESP32-S3-BOX-3](https://github.com/espressif/esp-box)

## Demo

* [Demo Video](https://youtu.be/feHGNeRQMss)
2 changes: 2 additions & 0 deletions examples/Box-3_LVGL9_Demo/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
idf_component_register(SRCS "main.c" "us_flag.c"
INCLUDE_DIRS ".")
18 changes: 18 additions & 0 deletions examples/Box-3_LVGL9_Demo/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## IDF Component Manager Manifest File
dependencies:
jmattsson/picotts: "^1.1.3"
espressif/esp-box-3: "^1.2.0~2"
## Required IDF version
idf:
version: ">=5.1.0"
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
193 changes: 193 additions & 0 deletions examples/Box-3_LVGL9_Demo/main/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
#include "esp_log.h"
#include "bsp/esp-bsp.h"
#include "lvgl.h"
#include "picotts.h"
#include <string.h>
#include "esp_log.h"

#define TTS_CORE 1

static esp_codec_dev_handle_t spk_codec;

const char greeting[] = "Hello. Welcome back to my project. This is Eric! You are listening to the voice of TTS. I love this so much.\0";
const char* greetings[] = {
"Hello.\0",
"Good Morning.\0",
"Good Bye.\0",
"Good Night.\0",
"How Are you?\0",
"Nice to see you.\0",
"Have a nice day.\0",
"I have to go.\0",
"Talk to you soon.\0",
"I'm using this device to speak.\0",
"See you later.\0",
"How was your day?\0",
"How was your weekend?\0",
"How was work?\0",
"What are you doing?\0",
};
const char* long_sentence = "There is lots of ways to be, as a person. And some people express their deep appreciation in different ways. But one of the ways that I believe people express their appreciation to the rest of humanity is to make something wonderful and put it out there.\0";

static lv_disp_t *display;
static lv_obj_t * currentButton = NULL;

static void on_samples(int16_t *buf, unsigned count)
{
esp_codec_dev_write(spk_codec, buf, count*2);
}

void triggerTTS(const char * text){
printf("Task says: %s\n", text); // Use the text
const size_t length = strlen(text) + 1; // +1 for null terminator
char arr[length]; // Allocate array large enough to hold the string
strcpy(arr, text); // Copy the string to
picotts_add(arr, sizeof(arr));
vTaskDelay(pdMS_TO_TICKS(2000));
}

static void event_handler(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = (lv_obj_t *)lv_event_get_target(e);
lv_obj_t * list1 = (lv_obj_t *)lv_event_get_user_data(e);

if(code == LV_EVENT_CLICKED) {
if(list1 != NULL){
if(currentButton == obj) {
currentButton = NULL;
}
else {
currentButton = obj;
}
lv_obj_t * parent = lv_obj_get_parent(obj);
for(uint32_t i = 0; i < lv_obj_get_child_count(parent); i++) {
lv_obj_t * child = lv_obj_get_child(parent, i);
if(child == currentButton) {
lv_obj_add_state(child, LV_STATE_CHECKED);
lv_obj_remove_flag(child, LV_OBJ_FLAG_CLICKABLE);
triggerTTS(lv_list_get_button_text(list1, obj));
}
else {
lv_obj_remove_state(child, LV_STATE_CHECKED);
lv_obj_add_flag(child, LV_OBJ_FLAG_CLICKABLE);
}
}
}else{
triggerTTS(long_sentence);
}
}
}

void lv_ui_menu(void)
{
static lv_style_t style_base;
lv_style_init(&style_base);
lv_style_set_border_width(&style_base, 0);

lv_obj_t *scr = lv_scr_act();
lv_obj_add_style(scr, &style_base, LV_PART_MAIN);
lv_obj_clear_flag(scr, LV_OBJ_FLAG_SCROLLABLE);

lv_obj_t * header_label = lv_label_create(scr);
lv_label_set_text(header_label, " Text-to-Speech (TTS)");
lv_obj_align(header_label, LV_ALIGN_TOP_LEFT, 0, 0);

LV_IMAGE_DECLARE(us_flag);
lv_obj_t * lang_flag = lv_image_create(scr);
lv_image_set_src(lang_flag, &us_flag);
lv_obj_align(lang_flag, LV_ALIGN_TOP_RIGHT, -8, 1);

lv_obj_t * lang_label = lv_label_create(scr);
lv_label_set_text(lang_label, " English (US) ");
lv_obj_align_to(lang_label, lang_flag, LV_ALIGN_OUT_LEFT_MID, 0, 0);

lv_obj_t * tabview;
tabview = lv_tabview_create(scr);
lv_tabview_set_tab_bar_position(tabview, LV_DIR_LEFT);
lv_tabview_set_tab_bar_size(tabview, 80);
lv_obj_align(tabview, LV_ALIGN_TOP_LEFT, 0, 20);
lv_obj_set_height(tabview, 220);
lv_obj_set_style_bg_color(tabview, lv_palette_lighten(LV_PALETTE_RED, 2), 0);

lv_obj_t * tab_buttons = lv_tabview_get_tab_bar(tabview);
lv_obj_set_style_bg_color(tab_buttons, lv_palette_darken(LV_PALETTE_GREY, 3), 0);
lv_obj_set_style_text_color(tab_buttons, lv_palette_lighten(LV_PALETTE_GREY, 5), 0);
lv_obj_set_style_border_side(tab_buttons, LV_BORDER_SIDE_RIGHT, LV_PART_ITEMS | LV_STATE_CHECKED);

lv_obj_t * tab1 = lv_tabview_add_tab(tabview, "Greetings");
lv_obj_t * tab2 = lv_tabview_add_tab(tabview, "E-Book\nStyle");
lv_obj_set_style_bg_color(tab1, lv_palette_lighten(LV_PALETTE_DEEP_ORANGE, 3), 0);
lv_obj_set_style_bg_opa(tab1, LV_OPA_COVER, 0);
lv_obj_set_style_bg_color(tab2, lv_palette_lighten(LV_PALETTE_INDIGO, 3), 0);
lv_obj_set_style_bg_opa(tab2, LV_OPA_COVER, 0);
lv_obj_remove_flag(lv_tabview_get_content(tabview), LV_OBJ_FLAG_SCROLLABLE);

// Tab1
lv_obj_t * list1 = lv_list_create(tab1);
lv_obj_set_size(list1, lv_pct(100), lv_pct(100));
lv_obj_set_style_pad_row(list1, 5, 0);
int numGreetings = sizeof(greetings) / sizeof(greetings[0]);
for (int i = 0; i < numGreetings; i++) {
lv_obj_t * btn = lv_button_create(list1);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, list1);
lv_obj_t * lab = lv_label_create(btn);
if(strlen(greetings[i]) > 20) lv_obj_set_width(lab, 150);
lv_label_set_text(lab, greetings[i]);
lv_label_set_long_mode(lab, LV_LABEL_LONG_SCROLL);
}

// Tab2
lv_obj_t * spans = lv_spangroup_create(tab2);
lv_obj_set_size(spans, lv_pct(100), lv_pct(100));
lv_spangroup_set_align(spans, LV_TEXT_ALIGN_LEFT);

lv_span_t * span = lv_spangroup_new_span(spans);
lv_span_set_text(span, long_sentence);
lv_style_set_text_color(lv_span_get_style(span), lv_color_black());
lv_style_set_text_decor(lv_span_get_style(span), LV_TEXT_DECOR_UNDERLINE);

// Create floating btn
lv_obj_t * float_btn = lv_button_create(tab2);
lv_obj_set_size(float_btn, 48, 48);
lv_obj_add_flag(float_btn, LV_OBJ_FLAG_FLOATING);
lv_obj_align(float_btn, LV_ALIGN_BOTTOM_RIGHT, -6, -6);
lv_obj_add_event_cb(float_btn, event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_set_style_radius(float_btn, LV_RADIUS_CIRCLE, 0);
lv_obj_set_style_bg_image_src(float_btn, LV_SYMBOL_PLAY, 0);
lv_obj_set_style_text_font(float_btn, lv_theme_get_font_large(float_btn), 0);
}

static void app_lvgl_display(void)
{
bsp_display_lock(0);
lv_ui_menu();
bsp_display_unlock();
}

void app_main(void)
{
ESP_ERROR_CHECK(bsp_i2c_init());
ESP_ERROR_CHECK(bsp_audio_init(NULL));
spk_codec = bsp_audio_codec_speaker_init();
assert(spk_codec);

esp_codec_dev_set_out_vol(spk_codec, 100);
esp_codec_dev_sample_info_t fs = {
.sample_rate = PICOTTS_SAMPLE_FREQ_HZ,
.channel = 1,
.bits_per_sample = PICOTTS_SAMPLE_BITS,
};
esp_codec_dev_open(spk_codec, &fs);

display = bsp_display_start();
bsp_display_backlight_on();
app_lvgl_display();

unsigned prio = uxTaskPriorityGet(NULL);
if (picotts_init(prio, on_samples, TTS_CORE))
{
picotts_add(greeting, sizeof(greeting));
vTaskDelay(pdMS_TO_TICKS(2000));
}
}
52 changes: 52 additions & 0 deletions examples/Box-3_LVGL9_Demo/main/us_flag.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#ifdef __has_include
#if __has_include("lvgl.h")
#ifndef LV_LVGL_H_INCLUDE_SIMPLE
#define LV_LVGL_H_INCLUDE_SIMPLE
#endif
#endif
#endif

#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif


#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif

#ifndef LV_ATTRIBUTE_IMAGE_US_FLAG
#define LV_ATTRIBUTE_IMAGE_US_FLAG
#endif

const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_US_FLAG uint8_t us_flag_map[] = {
0x8d, 0x11, 0x50, 0x2a, 0x4d, 0x01, 0xb1, 0x3a, 0x4d, 0x01, 0x90, 0x32, 0x4d, 0x09, 0x2f, 0x22, 0xae, 0x11, 0x8d, 0x09, 0x70, 0x2a, 0x4d, 0x01, 0xb1, 0x3a, 0x0b, 0x49, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8,
0x6d, 0x09, 0x0f, 0x22, 0xb0, 0x32, 0x2f, 0x22, 0xd1, 0x3a, 0x2f, 0x22, 0x90, 0x32, 0x0f, 0x22, 0x2f, 0x22, 0x70, 0x2a, 0x2f, 0x22, 0xb1, 0x3a, 0x2f, 0x22, 0xd1, 0x62, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed,
0x8e, 0x11, 0x90, 0x32, 0x0f, 0x22, 0xd1, 0x3a, 0x0f, 0x22, 0xb1, 0x3a, 0x0f, 0x22, 0x70, 0x32, 0x2f, 0x22, 0x0f, 0x22, 0x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ff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xae, 0x11, 0xf1, 0x42, 0x8e, 0x11, 0x52, 0x53, 0x8d, 0x11, 0x52, 0x4b, 0x8d, 0x11, 0xb1, 0x3a, 0x2f, 0x22, 0xce, 0x11, 0x12, 0x43, 0x8e, 0x11, 0x52, 0x53, 0xee, 0x51, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2,
0x73, 0x53, 0x73, 0x53, 0x52, 0x53, 0x93, 0x5b, 0x52, 0x53, 0x93, 0x5b, 0x52, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x5b, 0x52, 0x53, 0x93, 0x5b, 0x31, 0x83, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2, 0xef, 0xd2,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff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f6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6, 0x5a, 0xf6,
0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed, 0x37, 0xed,
0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8, 0xa8, 0xb8,
};

const lv_image_dsc_t us_flag = {
.header.cf = LV_COLOR_FORMAT_RGB565,
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.w = 34,
.header.h = 18,
.data_size = 612 * 2,
.data = us_flag_map,
};
7 changes: 7 additions & 0 deletions examples/Box-3_LVGL9_Demo/partitions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, , 0x6000,
phy_init, data, phy, , 0x1000,
factory, app, factory, , 2500K,
picotts_ta, 0x40, 0x0, , 640K,
picotts_sg, 0x40, 0x1, , 820K,
Loading