Skip to main content

Install

three (version 0.160 or later) renders the 3D avatar. React (18 or later) is only needed for the React component. The package is ESM-only.

JavaScript

The avatar plays the audio itself, in sync with its mouth. Don’t play the same audio anywhere else.
Browsers only allow sound after the user has interacted with the page. Call speak or attachStream from a click (or after one), or the audio, and with it the lip sync, stays silent.

React

Passing stream={null} detaches the stream. Changing avatarUrl swaps the avatar without recreating anything. The component cleans up when it unmounts. See the React reference.

Without a bundler

Use an import map:

Clean up

Need an avatar?

Your avatar must be a .glb with the Oculus viseme morph targets. See Avatars for the requirements, and how to map other morph names.

Next steps

Audio sources

Clips, live streams, and voice agents on OpenAI Realtime, LiveKit or Daily.

API reference

Every option and method of TalkingAvatar.