Build a Live2D Voice Assistant with TEN Framework
Imagine building a voice assistant that's more than just audio — one with an animated anime character that moves its lips in perfect sync with speech, reacts naturally, and brings conversations to life.
With the TEN Framework, you can create exactly that: a real-time Live2D voice assistant where animated characters respond to your voice with audio-driven mouth movement and seamless interaction.
In this tutorial, we'll show you how to integrate Live2D models with TEN's voice pipeline to create an immersive conversational experience.
What is this article all about?
TEN Framework provides the real-time audio pipeline (STT → LLM → TTS), and your job is to create a beautiful frontend that brings it to life:
- Real-time lip sync → mouth movements synchronized with TTS audio output.
- Interactive Live2D characters → 2D anime models that react and animate naturally.
- Seamless audio integration → Agora RTC streams audio directly to Live2D MotionSync.
- Modular backend → reuse the standard voice assistant backend, focus on frontend magic.
This means you get all the power of TEN's voice pipeline while delivering a visually engaging user experience that goes beyond traditional chatbots.
Project Structure
You don't need to build everything from scratch — TEN Framework provides a ready-to-use Live2D voice assistant example in the repository.
👉 Find it here: voice-assistant-live2d example on GitHub
Backend (tenapp)
The backend is essentially the same as other TEN voice assistant examples:
By default, it uses:
- Agora RTC for real-time audio streaming
- Deepgram for speech-to-text
- OpenAI LLM for conversation
- ElevenLabs for text-to-speech
Just like other TEN examples, you can easily swap in different vendors (e.g., use Google ASR, Azure TTS, Anthropic Claude, etc) using the graph designer at http://localhost:49483 (TMAN Designer) — no code changes needed. This gives you full flexibility to mix and match components to fit your needs.
The real innovation is in the frontend.
Frontend (Next.js + Live2D)
The frontend is where the magic happens:
This structure keeps rendering logic, audio processing, and RTC integration cleanly separated.
Frontend Implementation
The frontend brings the Live2D character to life. Let's break down the key parts:
PixiJS Setup
Before loading Live2D models, we need to initialize PixiJS globally because pixi-live2d-display
expects it.
pixi-setup.ts
handles this:
👉 This ensures PixiJS is available before any Live2D operations begin.
Loading Live2D Models
live2d-loader.ts
dynamically imports the Live2D library after PixiJS is ready:
👉 This lazy-loading strategy prevents SSR issues and ensures proper initialization order.
The Live2DCharacter Component
Live2DCharacter.tsx
is the heart of the frontend. It handles:
Model Initialization
MotionSync for Lip Sync
The component uses Live2D MotionSync to synchronize mouth movements with audio:
👉 This creates perfectly synchronized lip movements — the character's mouth moves exactly as it "speaks".
Agora RTC Integration
The main page (page.tsx
) connects everything:
Then pass it to the Live2D component:
👉 The character automatically syncs its mouth whenever the voice assistant speaks.
SSR Handling
Since Live2D requires browser APIs, we use dynamic imports to prevent SSR issues:
👉 This ensures the Live2D component only renders on the client side.
Test It Out
Ready to build your own Live2D voice assistant? Let's set it up.
Prerequisites
Follow the TEN Framework Getting Started guide for basic docker dev environment setup.
For detailed setup instructions specific to this example, refer to the README.md in the voice-assistant-live2d folder on GitHub.
Environment Variables
You'll need an environment file for the backend:
Backend (ai_agents/.env
)
Installation & Running
- Navigate to the example directory:
- Install dependencies:
- Run all services (in separate terminals):
- Open http://localhost:3000
- Click Connect to start the RTC session
- Start speaking — watch your Live2D character respond with perfectly synced lip movement!
✨ That's it — you now have a Live2D voice assistant powered by TEN Framework!