# Add a talking avatar to a web page or voice agent with one script tag

> Source: <https://www.stork.ai/blog/add-talking-avatar-to-voice-agent>
> Published: 2026-12-02 21:31:08+00:00

**Key takeaway:** Stork Live's avatar renders in the browser from an 8.1–8.5 MB avatar file plus a 3.3 MB lip model at about 20 ms of CPU per second of speech, so a thousand viewers cost the same as one; pass the agent's WebRTC audio track to live.speak() and don't also attach it to an audio element, since the avatar

Most real-time avatars are video. A GPU somewhere renders a face for each viewer and streams it, and you pay for each minute. Stork Live works the other way round. The avatar is a file. The browser downloads it once, draws it, and moves the lips from whatever sound you give it.

You can try it on [the Stork Live page](https://www.stork.ai/live) before reading on. The code that draws the face is open source under Apache 2.0, [on GitHub](https://github.com/jupiterspins/stork-live).

[Make one free](https://www.stork.ai/tools/talking-photo?utm_source=house_ad&utm_medium=inline&utm_campaign=talk-photo)

[Developers: there is an API](https://www.stork.ai/developers/talking-head-api?utm_source=house_ad&utm_medium=inline&utm_campaign=talk-photo-second)

## The whole setup[#](#the-whole-setup)

``` js
<canvas id="avatar"></canvas>
<script type="module">
  import { StorkLive } from 'https://cdn.jsdelivr.net/npm/stork-live@0.1/src/stork-live.js'

  const live = await StorkLive.mount(document.getElementById('avatar'), { avatar: 'a' })
  await live.speak(document.querySelector('audio'))
</script>
```

`mount` loads the avatar and returns when the first frame is on screen. `'a'`, `'b'`, `'c'` and `'d'` are the free library faces. `speak` plays the sound and moves the lips in step with it. Between calls the avatar blinks, moves its head and keeps its mouth at rest.

`speak` accepts an `<audio>` element, a WebRTC track or stream, or an `AudioBuffer`. With a bundler, run `npm install stork-live` and import from `'stork-live'`. A React component is at `'stork-live/react'`.

| Call | What it does | 
|---|---|
| `StorkLive.mount(canvas, options)` | Loads the avatar and starts drawing | 
| `live.speak(source)` | Plays the sound and moves the lips. Resolves when the sound ends | 
| `live.stop()` | Stops speaking. The avatar goes back to idling | 
| `live.destroy()` | Stops drawing and frees the worker | 

## Giving a voice agent a face[#](#giving-a-voice-agent-a-face)

Your agent already produces a voice. The avatar only needs to hear it. So there is nothing to install on the agent's side: the page takes the audio track the agent sends and passes it to `speak`.

**LiveKit:**

``` js
room.on(RoomEvent.TrackSubscribed, (track) => {
  if (track.kind === 'audio') live.speak(track.mediaStreamTrack)
})
```

**Pipecat** (with the small WebRTC transport):

``` js
const pcClient = new PipecatClient({
  transport: new SmallWebRTCTransport(),
  callbacks: {
    onTrackStarted: (track, participant) => {
      if (track.kind === 'audio' && !participant?.local) live.speak(track)
    },
  },
})
```

**OpenAI Realtime** (WebRTC):

``` js
pc.ontrack = (e) => live.speak(e.streams[0])
```

We ran all three against live agents on 2 December 2026, and the lips kept up in each case. The full pages, including the React version for LiveKit, are in [the voice-agent guide](https://github.com/jupiterspins/stork-live/blob/main/docs/voice-agents.md).

One thing to know: the avatar plays the sound itself, about a third of a second late, so that lips and voice line up. Do not also attach the agent's track to an audio element, or people will hear it twice.

Enjoying this? Get one like it in your inbox each morning.

one email a day · unsubscribe in two clicks · no third-party tracking

## What it costs to run[#](#what-it-costs-to-run)

|  | Size or speed | 
|---|---|
| Avatar download | 8.1 to 8.5 MB | 
| Lip model download | 3.3 MB | 
| Lip model work | About 20 ms of processor time per second of speech | 
| Draw rate, iPhone 15 Pro Max (Safari) | 60 frames a second | 
| Draw rate, Pixel 6 Pro (Chrome) | 60 frames a second | 

These are our own measurements from 1 and 2 December 2026. Nothing runs on a server while someone watches, so a thousand viewers cost the same as one: the file downloads.

## Free and paid[#](#free-and-paid)

- **Free.** Four library faces, any number of viewers and minutes, commercial use included. The picture carries a "Powered by stork.ai" mark, and the licence does not allow removing it.
- **Your own avatar, $29 a month.** You upload one photo. About 20 minutes later you get an avatar file without the mark, which you host wherever you like. The price is flat.[Order one here](https://www.stork.ai/live/new) .

## What it does not do[#](#what-it-does-not-do)

- It shows head and shoulders, facing the camera, at 512 pixels. No hands, no body, no camera moves.
- Fine detail is below what a server renders as video. Teeth and hair are the first places you will see it.
- The lip model was trained on English. It moves with other languages too, a step less accurately.
- It needs WebGL 2, which current browsers and phones from the last several years have.
- Where the law requires telling people they are talking to an AI, that is the page owner's job.

The terms for both the free faces and your own avatar are on [one page](https://www.stork.ai/live/terms).
