Skip to main content

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 voiceLiveKit voice
PlatformsAll (Win64/Mac/iOS/Android)Win64 / Mac
LatencyGoodLower
Echo cancellationNone (use push-to-talk)Built-in AEC
Full-duplex (hands-free)Not recommendedYes
SetupNoneOne-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:

  1. Requests a room token (RequestLiveKitToken).
  2. Joins the WebRTC room.
  3. Routes microphone capture and TTS playback through the room.
  4. Switches GetVoiceMode() to LiveKit.
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:

SettingDefaultDescription
LiveKit Echo Cancellation (AEC)OnEnable echo cancellation on the mic path.
AEC Stream Delay (ms)50Estimated 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.