Home

Awesome

Notice

This repository is temporarily frozen at v0.10.0. (Due to the absence of the administrator) We cannot respond to pull requests or ISSUE received.

M5Stack-Avatar

Powered By PlatformIO Build Status

M5Stack-Avatar

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

日本語

Features

Installation

Prerequisites

Using Arduino IDE

Using Platform IO

mkdir my-avatar
cd my-avatar
platformio init -d . -b m5stack-core-esp32
platformio lib install M5Unified
platformio lib install M5Stack-Avatar

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

#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

Notes for v0.10.0

Some applications may reboot due to insufficient stack size for other tasks. In such cases, increase the stack size of the relevant task.