Skip to main content

Noise & echo cancellation

Achieve crystal-clear audio for video conferencing and voice AI.

Overview

Your user's microphone is likely to pick up undesirable audio including background noise (like traffic, music, voices, etc) and might also pick up echoes from their own speakers. This noise leads to a poor experience for other participants in a call. In voice AI apps, it can also interfere with turn detection or degrade the quality of transcriptions.

LiveKit Cloud includes access to advanced noise cancellation models (Krisp and ai-coustics) so agents receive crystal-clear audio. Audio sent through LiveKit Cloud can use these models regardless of where your agent runs. See Agents for setup.

LiveKit SDKs support WebRTC noise and echo cancellation for conferencing apps via echoCancellation and noiseSuppression in any deployment. WebRTC cancellation runs in the client only, so it applies to conferencing. For agents and telephony (where there is no browser frontend), use the LiveKit Cloud models above. Adjust WebRTC settings with the AudioCaptureOptions type during connection. See WebRTC noise and echo cancellation in the Frontend section for more information.

To hear the effect of enhanced noise cancellation, play the samples below:

Agents

Enhanced noise cancellation is available when you use LiveKit Cloud for realtime transport. The following examples show how to set up noise cancellation inside your agent code. This applies noise cancellation to inbound audio and is the recommended approach for most voice AI use cases. The examples include audio comparisons that show the effect of each model on audio as perceived by a user and by a voice AI agent running an STT model (Deepgram Nova 3 in these samples). Segments marked with a strikethrough indicate unwanted content that would confuse the agent. Try the free noise canceller tool with your LiveKit Cloud account to test your own audio samples.

Tip

When using noise or background voice cancellation in the agent code, do not enable noise cancellation models in the frontend. Noise cancellation models are trained on raw audio and might produce unexpected results if the input has already been processed by a noise cancellation model in the frontend.

Standard noise cancellation and the separate echo cancellation feature can be left enabled.

There are two options:

  • Krisp: enhanced noise cancellation with optional background voice cancellation and telephony-optimized models.
  • ai-coustics: enhanced noise cancellation model tuned for voice and agent use.

Krisp

Krisp provides enhanced noise cancellation and background voice cancellation for agent inbound audio. The models run locally, with no audio data sent to Krisp servers and negligible impact on audio latency or quality.

Original Audio - Noisy Taxi Ride

Original Audio - Noisy Taxi Ride light waveform
STT by Deepgram Nova 3
Hi there, can you hear me alright? pretty bad Sorry it's pretty noisy in the taxi. sorry i can hear you pretty soon Okay so as I was saying I just heard about this platform called LiveKit - it's an all in one platform for voice AI agents with some pretty cool features. Have you heard about it?

With Krisp Noise Cancellation (NC)

With Krisp Noise Cancellation (NC) light waveform
STT by Deepgram Nova 3
Hi there, can you hear me alright? pretty bad Sorry it's pretty noisy in the taxi. sorry i'll get you there pretty soon Okay so as I was saying I just heard about this platform called LiveKit - it's an all in one platform for voice AI agents with some pretty cool features. Have you heard about it?

With Krisp Background Voice Cancellation (BVC)

With Krisp Background Voice Cancellation (BVC) light waveform
STT by Deepgram Nova 3
Hi there, can you hear me alright? Sorry it's pretty noisy in the taxi. Okay so as I was saying I just heard about this platform called LiveKit - it's an all in one platform for voice AI agents with some pretty cool features. Have you heard about it?

Model options

ModelDescription
NCStandard enhanced noise cancellation.
BVCBackground voice cancellation (NC + removes non-primary voices that would confuse transcription or turn detection).
BVCTelephonyBackground voice cancellation optimized for telephony applications.
# NC
noise_cancellation.NC()
# BVC
noise_cancellation.BVC()
# BVCTelephony
noise_cancellation.BVCTelephony()
import {
// NC
NoiseCancellation,
// BVC
BackgroundVoiceCancellation,
// BVCTelephony
TelephonyBackgroundVoiceCancellation,
} from '@livekit/noise-cancellation-node';

Installation

uv add "livekit-plugins-noise-cancellation~=0.2"
pnpm add @livekit/noise-cancellation-node

Usage

There are two ways to apply the filter: basic (using room options) and custom (using AudioStream).

Use the basic implementation when your agent uses the default session pipeline and you want the same noise cancellation applied to all inbound audio.

Include the filter in the room input options when starting your agent session:

from livekit.agents import room_io
from livekit.plugins import noise_cancellation
# ...
await session.start(
# ...,
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(
noise_cancellation=noise_cancellation.BVC(),
),
),
)
# ...
import { BackgroundVoiceCancellation } from '@livekit/noise-cancellation-node';
// ...
await session.start({
// ...,
inputOptions: {
noiseCancellation: BackgroundVoiceCancellation(),
},
});
// ...

Use the custom implementation when you create an AudioStream from a track yourself (for example in a job with custom track handling or when iterating over frames for STT).

Apply the filter when constructing the stream so that the frames you read are already filtered:

from livekit.rtc import AudioStream
from livekit.plugins import noise_cancellation
stream = AudioStream.from_track(
track=track,
noise_cancellation=noise_cancellation.BVC(),
)
import { AudioStream } from '@livekit/rtc-node';
import { BackgroundVoiceCancellation } from '@livekit/noise-cancellation-node';
const stream = new AudioStream(track, {
noiseCancellation: BackgroundVoiceCancellation(),
});

ai-coustics

ai-coustics provides realtime noise filtering and audio enhancement for agent inbound audio.

Tip

The ai-coustics plugin is built for use in the Python and Node.js agents SDK only, and is not supported on clients for video conferencing.

Original Audio - Conversation

Original Audio - Conversation light waveform
STT by Deepgram Nova 3
Yeah. No problem. That's up to you. Right? It's a little bit pitched. You may wanna know if you're in the class. Yep. Yeah. And do you guys have Yep. An impression too? Three. Maybe, like

With ai-coustics Quail (QUAIL_L)

With ai-coustics Quail (QUAIL_L) light waveform
STT by Deepgram Nova 3
Yeah. No problem. It's a little bit pitched. Yep. Yeah. And do you guys have Yep. An impression too? Three. Maybe.

With ai-coustics Voice Focus (QUAIL_VF_L)

With ai-coustics Voice Focus (QUAIL_VF_L) light waveform
STT by Deepgram Nova 3
Yeah. No problem. It's a little bit pitched. Yep. Yep. Three.

Model options

ModelDescription
QUAIL_LPurpose-built for Voice AI Agents and human-to-machine interactions. Tuned to improve downstream Speech-to-Text (STT) performance rather than general voice enhancement.
QUAIL_VF_LVoice Focus variant that elevates the foreground speaker while suppressing interfering speech and background noise. Higher quality for agent use, but incurs additional cost.
# QUAIL_L
ai_coustics.audio_enhancement(model=EnhancerModel.QUAIL_L)
# QUAIL_VF_L
ai_coustics.audio_enhancement(model=EnhancerModel.QUAIL_VF_L)
import * as aiCoustics from '@livekit/plugins-ai-coustics';
// QUAIL_L
aiCoustics.audioEnhancement({ model: EnhancerModel.QUAIL_L })
// QUAIL_VF_L
aiCoustics.audioEnhancement({ model: EnhancerModel.QUAIL_VF_L })

Installation

uv add "livekit-plugins-ai-coustics"
pnpm add @livekit/plugins-ai-coustics

Usage

There are two ways to apply the filter: basic (using room options) and custom (using AudioStream).

Use the basic implementation when your agent uses the default session pipeline and you want the same noise cancellation applied to all inbound audio.

Include the filter in the room input options when starting your agent session:

from livekit.agents import room_io
from livekit.plugins import ai_coustics, EnhancerModel
# ...
await session.start(
# ...,
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(
noise_cancellation=ai_coustics.audio_enhancement(model=EnhancerModel.QUAIL_L),
),
),
)
# ...
import * as aiCoustics from '@livekit/plugins-ai-coustics';
// ...
await session.start({
// ...,
inputOptions: {
noiseCancellation: aiCoustics.audioEnhancement({ model: "quailL" }),
},
});
// ...

VAD adapter

The ai-coustics plugin also exposes a VAD adapter for turn detection. VAD is built into the ai-coustics model, so you can skip running a separate VAD (such as Silero) entirely.

from livekit.plugins.ai_coustics import audio_enhancement, VAD, EnhancerModel
vad=VAD()
noise_cancellation=audio_enhancement(model=EnhancerModel.QUAIL_L)
import * as aic from '@livekit/plugins-ai-coustics';
vad: aic.vad(),
noiseCancellation: aic.audioEnhancement(),

Telephony

Krisp noise cancellation can be applied directly at your SIP trunk for inbound or outbound calls. This uses the standard Krisp noise cancellation (NC) model. Other models are not available for SIP.

Inbound

Include krisp_enabled: true in the inbound trunk configuration.

{
"trunk": {
"name": "My trunk",
"numbers": ["+15105550100"],
"krisp_enabled": true
}
}

See the full inbound trunk docs for more information.

Outbound

Include krisp_enabled: true in the CreateSipParticipant request.

request = CreateSIPParticipantRequest(
sip_trunk_id = "<trunk_id>",
sip_call_to = "<phone_number>",
room_name = "my-sip-room",
participant_identity = "sip-test",
participant_name = "Test Caller",
krisp_enabled = True,
wait_until_answered = True
)

See the full outbound call docs for more information.

Frontend

Noise cancellation in the frontend applies to outbound audio before it is sent to the room.

Krisp

The following examples show how to set up noise cancellation in the frontend using Krisp. This applies noise cancellation to outbound audio. The BVC model is available in the JavaScript frontend; other frontend SDKs support the NC model only.

PlatformOutboundBVCPackage
Web@livekit/krisp-noise-filter
SwiftLiveKitKrispNoiseFilter
Androidio.livekit:krisp-noise-filter
Flutterlivekit_noise_filter
React Native@livekit/react-native-krisp-noise-filter
UnityN/A
Tip

When using noise or background voice cancellation in the frontend, do not enable Krisp noise cancellation in the agent code. Standard noise cancellation and the separate echo cancellation feature can be left enabled.

Installation

npm install @livekit/krisp-noise-filter

This package includes the Krisp SDK but not the models, which downloads at runtime to minimize the impact on your application's bundle size.

React components usage

LiveKit Components includes a convenient useKrispNoiseFilter hook to easily integrate Krisp into your React app:

import { useKrispNoiseFilter } from '@livekit/components-react/krisp';
function MyKrispSetting() {
const krisp = useKrispNoiseFilter();
return (
<input
type="checkbox"
onChange={(ev) => krisp.setNoiseFilterEnabled(ev.target.checked)}
checked={krisp.isNoiseFilterEnabled}
disabled={krisp.isNoiseFilterPending}
/>
);
}

Base JS SDK usage

For other frameworks or advanced use cases, use the KrispNoiseFilter class directly:

import { type LocalAudioTrack, Room, RoomEvent, Track } from 'livekit-client';
const room = new Room();
// We recommend a dynamic import to only load the required resources when you enable the plugin
const { KrispNoiseFilter } = await import('@livekit/krisp-noise-filter');
room.on(RoomEvent.LocalTrackPublished, async (trackPublication) => {
if (
trackPublication.source === Track.Source.Microphone &&
trackPublication.track instanceof LocalAudioTrack
) {
if (!isKrispNoiseFilterSupported()) {
console.warn('Krisp noise filter is currently not supported on this browser');
return;
}
// Once instantiated, the filter will begin initializing and will download additional resources
const krispProcessor = KrispNoiseFilter();
console.log('Enabling LiveKit Krisp noise filter');
await trackPublication.track.setProcessor(krispProcessor);
// To enable/disable the noise filter, use setEnabled()
await krispProcessor.setEnabled(true);
// To check the current status use:
// krispProcessor.isEnabled()
// To stop and dispose of the Krisp processor, simply call:
// await trackPublication.track.stopProcessor()
}
});

Available models

The JavaScript noise filter supports the standard Krisp noise cancellation (NC) and background voice cancellation (BVC) models.

Compatibility

Not all browsers support the underlying Krisp SDK (including Safari <17.4). Use isKrispNoiseFilterSupported() to check if the current browser is supported.

Installation

Add the package to your build.gradle file:

dependencies {
implementation "io.livekit:krisp-noise-filter:0.0.10"
}

Get the latest SDK version number from Maven Central.

Usage

val krisp = KrispAudioProcessor.getInstance(getApplication())
coroutineScope.launch(Dispatchers.IO) {
// Only needs to be done once.
// This should be executed on the background thread to avoid UI freezes.
krisp.init()
}
// Pass the KrispAudioProcessor into the Room creation
room = LiveKit.create(
getApplication(),
overrides = LiveKitOverrides(
audioOptions = AudioOptions(
audioProcessorOptions = AudioProcessorOptions(
capturePostProcessor = krisp,
)
),
),
)
// Or to set after Room creation
room.audioProcessingController.setCapturePostProcessing(krisp)

Available models

The Android noise filter supports only the standard Krisp noise cancellation (NC) model.

Installation

Add a new package dependency to your app by URL:

https://github.com/livekit/swift-krisp-noise-filter

Or in your Package.swift file:

.package(url: "https://github.com/livekit/swift-krisp-noise-filter.git", from: "0.0.7"),

Usage

Here is a simple example of a SwiftUI app that uses Krisp in its root view:

import LiveKit
import SwiftUI
import LiveKitKrispNoiseFilter
// Keep this as a global variable or somewhere that won't be deallocated
let krispProcessor = LiveKitKrispNoiseFilter()
struct ContentView: View {
@StateObject private var room = Room()
var body: some View {
MyOtherView()
.environmentObject(room)
.onAppear {
// Attach the processor
AudioManager.shared.capturePostProcessingDelegate = krispProcessor
// This must be done before calling `room.connect()`
room.add(delegate: krispProcessor)
// You are now ready to connect to the room from this view or any child view
}
}
}

For a complete example, view the Krisp sample project.

Available models

The Swift noise filter supports only the standard Krisp noise cancellation (NC) model.

Compatibility

Installation

npm install @livekit/react-native-krisp-noise-filter

This package includes both the Krisp SDK and the required models.

Usage

import { KrispNoiseFilter } from '@livekit/react-native-krisp-noise-filter';
import { useLocalParticipant } from '@livekit/components-react';
import { useMemo, useEffect } from 'react';
function MyComponent() {
let { microphoneTrack } = useLocalParticipant();
const krisp = useMemo(() => KrispNoiseFilter(), []);
useEffect(() => {
const localAudioTrack = microphoneTrack?.audioTrack;
if (!localAudioTrack) {
return;
}
localAudioTrack?.setProcessor(krisp);
}, [microphoneTrack, krisp]);
}

Available models

The React Native noise filter supports only the standard Krisp noise cancellation (NC) model.

Installation

Add the package to your pubspec.yaml file:

dependencies:
livekit_noise_filter: ^0.1.0

Usage

import 'package:livekit_client/livekit_client.dart';
import 'package:livekit_noise_filter/livekit_noise_filter.dart';
// Create the noise filter instance
final liveKitNoiseFilter = LiveKitNoiseFilter();
// Configure room with the noise filter
final room = Room(
roomOptions: RoomOptions(
defaultAudioCaptureOptions: AudioCaptureOptions(
processor: liveKitNoiseFilter,
),
),
);
// Connect to room and enable microphone
await room.connect(url, token);
await room.localParticipant?.setMicrophoneEnabled(true);
// You can also enable/disable the filter at runtime
// liveKitNoiseFilter.setBypass(true); // Disables noise cancellation
// liveKitNoiseFilter.setBypass(false); // Enables noise cancellation

Available models

The Flutter noise filter supports only the standard Krisp noise cancellation (NC) model.

Compatibility

The Flutter noise filter is currently supported only on iOS, macOS, and Android platforms.

WebRTC noise and echo cancellation

As an alternative to Krisp, the LiveKit SDKs support built-in outbound noise and echo cancellation based on the WebRTC implementations of echoCancellation and noiseSuppression. You can adjust these settings with the AudioCaptureOptions type in the LiveKit SDKs during connection. Leaving these WebRTC settings on is strongly recommended when you are not using enhanced noise cancellation (Krisp or ai-coustics).

Original

Original light waveform

WebRTC noiseSuppression

WebRTC noiseSuppression light waveform