• Stars
    star
    169
  • Rank 224,453 (Top 5 %)
  • Language
    C++
  • License
    MIT License
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An M5Stack library for rendering avatar faces

M5Stack-Avatar

Powered By PlatformIO Build Status

M5Stack-Avatar

Video: https://www.youtube.com/watch?v=C1Hj9kfY5qc

ๆ—ฅๆœฌ่ชž

Features

  • ๐Ÿ˜ Draw avatar face
  • ๐Ÿ˜„ Expression(Happy, Angry, Sad etc.)
  • ๐Ÿ˜บ Customize face
  • ๐Ÿ’‹ Lip sync
  • ๐ŸŽจ Color Palette
  • ๐Ÿ”ƒ Move, Zoom and Rotation
  • 2๏ธโƒฃ Compatible with M5Stack Core2

Installation

Prerequisites

Using Arduino IDE

  • On Arduino IDE, Select "Sketch > Include Library > Manage Libraries..."
  • Search "m5stack avatar"
  • Select "M5Stack_Avatar" from the results then click "Install"
  • The library gets installed

Using Platform IO

  • Initialize your Platform IO project
mkdir my-avatar
cd my-avatar
platformio init -d . -b m5stack-core-esp32
  • Install the library and its dependency
platformio lib install M5Unified
platformio lib install M5Stack-Avatar
  • The library gets downloaded from repository to .piolibdeps directory

Usage

#include <M5Unified.h>
#include <Avatar.h>

using namespace m5avatar;

Avatar avatar;

void setup()
{
  M5.begin();
  avatar.init(); // start drawing
}

void loop()
{
  // avatar's face updates in another thread
  // so no need to loop-by-loop rendering
}

Using LipSync

  • setup AquesTalk-ESP32 (http://blog-yama.a-quest.com/?eid=970195).

    • (For parsing Kainji statement) Copy the dictionary file from above link to the microSD card.
    • You don't need to copy AquesTalkTTS files. They are included in this library.
  • Write below to open avatar mouth according to the audio output.

#include <AquesTalkTTS.h>
#include <M5Unified.h>
#include <Avatar.h>
#include <tasks/LipSync.h>

using namespace m5avatar;

// AquesTalk License Key
// NULL or wrong value is just ignored
const char* AQUESTALK_KEY = "XXXX-XXXX-XXXX-XXXX";
Avatar avatar;

void setup() {
  int iret;
  M5.begin();
  // For Kanji-to-speech mode (requires dictionary file saved on microSD)
  // iret = TTS.createK(AQUESTALK_KEY);
  iret = TTS.create(AQUESTALK_KEY);
  avatar.init();
  avatar.addTask(lipSync, "lipSync");
}

void loop() {
  M5.update();
  if (M5.BtnA.wasPressed()) {
    // For Kanji-to-speech mode
    // TTS.play("ใ“ใ‚“ใซใกใฏใ€‚", 80);
    TTS.play("konnichiwa", 80);
  }
}

Further usage

see examples directory.

Migration from 0.7.x to 0.8.x

M5Stack-Avatar now depends on M5Unified, the integrated library for all devices of M5Stack series. Since 0.8.0, Sketches with avatar should include M5Unified.h instead of M5Stack.h or M5Core2.h

More Repositories

1

stack-chan

A JavaScript-driven M5Stack-embedded super-kawaii robot.
TypeScript
709
star
2

vue-maze

A Vue.js component of a simple maze game.
Vue
65
star
3

moddable-examples

A bunch of example codes with Moddable SDK.
JavaScript
34
star
4

vue-8-puzzle

A simple 8-puzzle game made as a Vue.js component
JavaScript
31
star
5

M5Mouse

A micro mouse module made for M5Stack
C
14
star
6

awesome-m5stack

A collection of awesome things regarding M5Stack ecosystem
11
star
7

UnitV2Framework

C
9
star
8

moddable-boilerplate

Yet another moddableSDK project boilerplate with typescript, eslint and prettier.
TypeScript
8
star
9

moddable-avatar

Yet another fun avatar face module for Moddable SDK.
TypeScript
8
star
10

avatar_ros

Yet another super-kawaii face package for ROS 2
Python
7
star
11

deviceconnect-plugin-sjcam

A DeviceConnect plugin for SJCAM.
Java
3
star
12

suburi-mediapipe

TypeScript
3
star
13

docker-moddable-esp32

Shell
3
star
14

robot-manipulation-in-typescript

Yet another implementation of robot manipulation in TypeScript
TypeScript
3
star
15

suburi-embedded-rust

Rust
3
star
16

moddable-scservo

TypeScript
2
star
17

comentodon

JavaScript
2
star
18

printable-cards

TypeScript
2
star
19

deep-learning-from-scratch

Studying "Deep Learning From Scratch" by myself.
Jupyter Notebook
2
star
20

minesweeper-standalone

JavaScript
2
star
21

simple-stt-server

A simple text-to-speech server that uses VOSK to recognize speech and send it over WebSocket
HTML
2
star
22

slides-tskaigi2024

Stack-chan presentation for tskaigi2024
JavaScript
1
star
23

spa-practice

sample project for "Single Page Web Applications"
JavaScript
1
star
24

maze

Yet another maze game powerd by Rust and WebAssembly
JavaScript
1
star
25

dotfiles

config files
Shell
1
star
26

hac-chan

A robot project for the Humanoid Autonomous Challenge (HAC)
C++
1
star
27

suburi-moddable

1
star
28

how-to-make-stackchan

A guide book for developing open source hardware like Stack-chan.
TeX
1
star
29

line-things-starter-moddable

A third party example of LINE Things starter example built on Moddable SDK
JavaScript
1
star
30

m5stack-namecard

A library to display a name card on M5Stack
1
star
31

suburi-rust

wannabe a rustacean.
Rust
1
star
32

redroom

CSS
1
star
33

meganetaaan

1
star
34

machi

a tiny order-waiting kanban app inspired by one in a fast-food restaurant.
JavaScript
1
star
35

csv-server

CSV to JSON server, made easy.
JavaScript
1
star
36

moddable-plen5stack

TypeScript
1
star
37

docker-moddable-esp32-nodejs

Dockerfile
1
star