What is RTC Mode?
RTC Mode enables real-time voice communication with avatars through LiveKit. It builds on top of Host Mode — the@spatialwalk/avatarkit-rtc adapter package handles the RTC connection and feeds audio/animation data to the SDK automatically.
Web Only: RTC Mode is currently available for Web applications only. iOS and Android support is planned for a future release. In the meantime, native mobile platforms can use Host Mode with your own RTC implementation.
AvatarKit Voice Agent Demo
A full reference repository with implementation details, including different frontend UI options and multiple backend agent patterns.
When to Use
- Real-time voice conversation — users talk to an avatar via microphone
- Low-latency interaction — WebRTC provides sub-second latency
- Server-side AI — your RTC server processes audio and generates responses
Packages Required
| Package | Purpose | Required |
|---|---|---|
@spatialwalk/avatarkit | Avatar rendering SDK | Yes |
@spatialwalk/avatarkit-rtc | RTC adapter | Yes |
[email protected] | LiveKit RTC SDK | Yes |
LiveKit Browser Compatibility
| Browser | Minimum Version |
|---|---|
| Chrome | 94+ |
| Firefox | 117+ |
| Safari | 15.4+ |
| Edge | 94+ |
How It Works
RTC Mode uses the SDK in Host Mode internally. TheAvatarPlayer acts as a bridge:
- Initializes the avatar SDK with
DrivingServiceMode.host - Connects to the RTC server via the chosen provider
- Publishes your microphone audio to the RTC server
- Receives animation and audio data from the RTC server
- Feeds animation data into the avatar SDK for rendering; audio is played through the native WebRTC audio track by the RTC provider
yieldAudioData() or yieldFramesData() manually — the adapter handles this.
What RTC Mode Does NOT Use
Although RTC Mode builds on Host Mode internally, the following SDK/Host Mode features are not used in RTC Mode:| Feature | Used in SDK/Host Mode | Used in RTC Mode |
|---|---|---|
initializeAudioContext() | Yes — required for Web Audio API playback | No — audio is played via WebRTC tracks |
| Internal audio player | Yes — SDK decodes and plays audio internally | No — RTC provider handles audio playback |
yieldAudioData() / yieldFramesData() | Yes — you call these manually | No — the adapter calls them internally |
start() / send() / close() | Yes (SDK Mode only) | No |
Server-Side Setup
Your backend is responsible for sending audio to the avatar service and having the resulting avatar stream published to your RTC room. Two approaches are available:| Platform | Framework plugin | Server SDK + egress |
|---|---|---|
| LiveKit | LiveKit Agents plugin — hooks into your agent pipeline and publishes to the room | LiveKit Server (section 2) — use AvatarKit Server SDK with LiveKit egress config |
- Framework plugin: Best if you already use LiveKit Agents. The plugin handles audio → SpatialReal → RTC publish for you.
- Server SDK + egress: Use the Golang or Python Server SDK, create a session with LiveKit egress config, and send audio. The avatar service publishes audio and animation directly to the RTC room; your server does not relay that data.
@spatialwalk/avatarkit-rtc to render the avatar. See the client guides below.
Get Started
Client (browser)LiveKit Client
Connect with LiveKit RTC
LiveKit Server
Plugin or Server SDK with LiveKit egress

