LiveKit
Stork Live · tested 2026-12-02
Give a LiveKit agent a face. The agent's code does not change.
Before you start
A LiveKit agent that already speaks, and a page that joins its room.
Code
// in the page: the agent's code does not change, and there is no avatar worker to start
const live = await StorkLive.mount(canvas, { avatar: 'a', siteKey: 'YOUR_SITE_KEY' })
room.on(RoomEvent.TrackSubscribed, (track) => {
if (track.kind === 'audio') live.speak(track.mediaStreamTrack) // do not call track.attach()
})In React, with LiveKit's components:
import { useVoiceAssistant } from '@livekit/components-react'
import { StorkLiveAvatar } from 'stork-live/react'
function AgentFace() {
const { audioTrack } = useVoiceAssistant() // the agent's voice
const track = audioTrack?.publication?.track?.mediaStreamTrack ?? null
return <StorkLiveAvatar avatar="a" audio={track} style={{ width: 360 }} />
}To choose the face in the agent's code there is also a plugin for LiveKit Agents. It starts no worker. It is in review at LiveKit; the source is in https://github.com/jupiterspins/stork-live/tree/main/integrations/livekit.
Check it works
A face that blinks, with the Powered by stork.ai mark in the corner. When your audio plays, the lips move.
If it does not
- You hear the voice twice. Do not call track.attach(). In React, leave <RoomAudioRenderer /> out, or mute the agent in it.
- No sound until a click. Browsers only start sound after a click or tap. Create the AudioContext in a click handler and set it as live.ctx before the first speak.
- A black box. The browser has no WebGL 2.
Next
Change the letter to change the face: 'a' to 'h' are free. To use a face of your own without the mark, see Your own avatar.
