Avatar Live
Realtime avatar animation with audio-driven facial expressions
Realtime avatar animation with audio-driven facial expressions
Documentation1 Credit Per Second
1 Credit Per Second
Select a default portrait or upload your own image (max 5MB)
Upload audio file
or
Click to record audio
Select an image to begin
import { createDecartClient, models } from "@decartai/sdk";
const model = models.realtime("live_avatar");
const client = createDecartClient({
apiKey: "--your-api-key--"
});
// Option 1: Use playAudio() to inject audio files
const realtimeClient = await client.realtime.connect(null, {
model,
avatar: {
avatarImage: "/path/to/avatar.jpg", // URL, File, or Blob
},
onRemoteStream: (videoStream) => {
const videoElement = document.querySelector("#avatar-output");
videoElement.srcObject = videoStream;
}
});
// Play audio through the avatar
const audioBlob = await fetch("/speech.mp3").then(r => r.blob());
await realtimeClient.playAudio(audioBlob);
// Disconnect when done
realtimeClient.disconnect();
// Option 2: Use mic input directly
const micStream = await navigator.mediaDevices.getUserMedia({
audio: true,
video: false
});
const realtimeClient2 = await client.realtime.connect(micStream, {
model,
avatar: {
avatarImage: avatarFile, // File or Blob
},
onRemoteStream: (videoStream) => {
videoElement.srcObject = videoStream;
}
});
// Avatar now speaks whatever the user says into the micAvailable Endpoints
Request Parameters
imageRequiredType:File
Portrait image to animate (WebRTC)
audioRequiredType:File
Audio stream for animation (WebRTC)
Parameter
Type
Required
Description
imageFileYesPortrait image to animate (WebRTC)audioFileYesAudio stream for animation (WebRTC)Avatar Live
Generate real time, natural avatar video from image and audio
Animate any image using audio in real-time. Stream audio, and get your avatar image speaking and moving naturally without lag.
Pricing
Model
pro
720p
1 Creditsper 1s
Video models are charged per second of generated video. Final cost depends on video duration and selected resolution.