LiveKit Integration
Optional WebRTC voice transport for Win64 and Mac, with hardware-grade acoustic echo cancellation. When present, it replaces the WebSocket audio path for lower latency and hands-free, full-duplex conversation.
When to Use LiveKit
| WebSocket voice | LiveKit voice | |
|---|---|---|
| Platforms | All (Win64/Mac/iOS/Android) | Win64 / Mac |
| Latency | Good | Lower |
| Echo cancellation | None (use push-to-talk) | Built-in AEC |
| Full-duplex (hands-free) | Not recommended | Yes |
| Setup | None | One-time binary fetch |
Use LiveKit on desktop for the best open-mic experience. Mobile uses WebSocket voice.
Enabling LiveKit
LiveKit voice requires the prebuilt WebRTC binaries, fetched once per workstation:
- Windows:
powershell -ExecutionPolicy Bypass -File Plugins/Estuary/ThirdParty/Setup.ps1
- macOS:
bash Plugins/Estuary/ThirdParty/Setup.sh
This downloads the pinned release and lays it out under Plugins/Estuary/ThirdParty/livekit-client-sdk-cpp/. Rebuild the project — the SDK auto-detects the binaries and compiles LiveKit support.
When the binaries are absent (or Disable LiveKit is set in Project Settings), the module still compiles and voice falls back to WebSocket transparently.
How It's Used
You don't call LiveKit APIs directly. When voice starts and LiveKit is available, the SDK automatically:
- Requests a room token (
RequestLiveKitToken). - Joins the WebRTC room.
- Routes microphone capture and TTS playback through the room.
- Switches
GetVoiceMode()toLiveKit.
if (Estuary->GetVoiceMode() == EEstuaryVoiceMode::LiveKit)
{
// Full-duplex voice with echo cancellation is active
}
// Manually leave the room and revert to WebSocket voice
Estuary->LeaveLiveKitRoom();
Echo Cancellation
LiveKit voice cancels the character's own TTS from the microphone input so an open mic doesn't feed the character's voice back into the conversation.
Project Settings → Plugins → Estuary → Audio:
| Setting | Default | Description |
|---|---|---|
| LiveKit Echo Cancellation (AEC) | On | Enable echo cancellation on the mic path. |
| AEC Stream Delay (ms) | 50 | Estimated render+capture latency. Raise for high-latency output devices (e.g., Bluetooth headsets). |
If echo persists, increase AEC Stream Delay. Echo cancellation applies to LiveKit voice only; WebSocket voice relies on push-to-talk or the microphone SetSuppressed guard.
Development Tip
To iterate without using LiveKit credits, set Disable LiveKit (WebSocket-only voice) in Project Settings. The microphone still streams and TTS still plays — just over WebSocket.