How to setup noise cancellation for self hosted li...
# ask-ai
e
How to setup noise cancellation for self hosted livekit server , both for phone and web
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You asked how to set up noise cancellation for a self‑hosted LiveKit server for both phone and web. Quick answer and next steps below. 1) Web & mobile (JS/Android/iOS) • Enable WebRTC client-side suppression: set
noiseSuppression: true
and
echoCancellation: true
in your audio capture options in the LiveKit SDKs or when calling getUserMedia. ◦ Example (JS):
Copy code
const room = await connect(url, {
      audioCaptureDefaults: {
        noiseSuppression: true,
        echoCancellation: true,
      }
    });
• This runs in the client (browser / mobile SDK) and is the supported noise suppression approach for self-hosting. 2) Phone (SIP / PSTN) • Krisp / LiveKit Cloud advanced noise cancellation is not available for self-hosted SIP. The
krisp_enabled
features only work with LiveKit Cloud or LiveKit-managed trunks. • For self-hosted SIP, handle noise cancellation via your SIP/media gateway or use audio-processing tools before sending audio into LiveKit (e.g., Opus with proper encoder settings, external DSP, or a media proxy that applies noise suppression). 3) If you need stronger noise removal than WebRTC provides • Options: ◦ Run an external audio preprocessing service (client-side or a media-processing server) that applies advanced models (third‑party DSP, RNNoise, RNNoise-derived, or commercial libraries) before sending audio to LiveKit. ◦ Move the voice path (or agent components that require advanced denoising) to LiveKit Cloud where Krisp/BVC is available. Quick clarifying questions so I can give precise code/config steps: • Is this for browser, native mobile apps, or both? • Are SIP calls terminated by a self-hosted SIP server or via a provider/LiveKit trunk? • Do you use LiveKit Agents/voice AI that ingest the audio? Tell me those and I’ll provide exact code snippets and configuration guidance. Sources: Enhanced noise cancellation | LiveKit docs | Voice AI quickstart | LiveKit docs | Noise & echo cancellation | LiveKit docs | examples/bank-ivr | livekit/livekit_composite | DeepWiki | sip | livekit/livekit_composite | DeepWiki