cold-belgium-91163
08/29/2025, 5:02 AMtall-airline-16756
08/29/2025, 5:02 AMtall-airline-16756
08/29/2025, 5:03 AMLocalAudioTrack
either just before or right as you publish it.
Here’s a handy example: you can set up the noise cancellation filter when you catch the RoomEvent.LocalTrackPublished
event, which happens right after the track is published:
room.on(RoomEvent.LocalTrackPublished, async (trackPublication) => {
if (trackPublication.source === Track.Source.Microphone &&
trackPublication.track instanceof LocalAudioTrack) {
const krispProcessor = KrispNoiseFilter();
await trackPublication.track.setProcessor(krispProcessor);
await krispProcessor.setEnabled(true);
}
});
This way, your noise cancellation will be up and running for the entire time the track is being used in your session. Pretty neat, right?
Sources: components/room.tsx | Enhanced noise cancellation | LiveKit Docscold-belgium-91163
08/29/2025, 5:03 AMtall-airline-16756
08/29/2025, 5:04 AMisKrispNoiseFilterSupported()
to see if it’s compatible. Here’s a quick example:
import { isKrispNoiseFilterSupported } from '@livekit/krisp-noise-filter';
if (!isKrispNoiseFilterSupported()) {
console.warn('Krisp noise filter is not supported in this browser');
}
1. Proper Initialization: Make sure the KrispNoiseFilter
is set up correctly and applied to your LocalAudioTrack
right after it’s published. Check out this snippet:
room.on(RoomEvent.LocalTrackPublished, async (trackPublication) => {
if (trackPublication.track instanceof LocalAudioTrack) {
const krispProcessor = KrispNoiseFilter();
await trackPublication.track.setProcessor(krispProcessor);
await krispProcessor.setEnabled(true);
}
});
1. Deployment: Just a heads-up, enhanced noise cancellation with Krisp is available only on LiveKit Cloud, not on self-hosted setups.
2. Conflicts: Try to avoid turning on both client-side and server-side noise cancellation at the same time to prevent issues.
3. Track Status: You can check if noise cancellation is active by keeping an eye on the enhancedNoiseCancellation
property of your LocalAudioTrack
.
If any of this feels unclear or you want me to help you step-by-step, just let me know—I’m here to help!
Sources: Enhanced noise cancellation | LiveKit Docs | AI noise cancellation | LiveKit Docs | src/room/track/LocalAudioTrack.ts | Speech & Audio Processing | livekit/livekit_composite | DeepWiki | Understanding "silence detected on local audio track" warningcold-belgium-91163
08/29/2025, 6:30 AMtall-airline-16756
08/29/2025, 6:31 AMKrispNoiseFilter
in the LiveKit JS SDK. The SDK lets you plug in your own audio processors using the setProcessor
method on LocalAudioTrack
, so you have full control to add your own audio processing magic.
Here’s a quick example to show you how to apply a custom processor:
room.on(RoomEvent.LocalTrackPublished, async (trackPublication) => {
if (trackPublication.track instanceof LocalAudioTrack) {
// Apply your custom processor
await trackPublication.track.setProcessor(customProcessor);
}
});
Just a heads up: while the way you integrate is the same, custom processors can’t fully replicate the proprietary Krisp models or some of the advanced features like Background Voice Cancellation (BVC) — those are only available server-side in Python or Node.js.
If you have any specific ideas or features you want to build with your custom processor, feel free to share! I’d be happy to help you figure out the best way to make it happen.
Sources: Enhanced noise cancellation | LiveKit Docs | src/room/track/LocalAudioTrack.ts | components/room.tsx | components/room.tsx | Sources/LiveKit/Protocols/AudioCustomProcessingDelegate.swift