rapid-hamburger-23505
02/15/2026, 1:29 PMtall-airline-16756
02/15/2026, 1:29 PMtall-airline-16756
02/15/2026, 1:29 PMuv add "livekit-plugins-noise-cancellation~=0.2"
1. In your agent session, set the audio input noise filter to BVC() when starting the room/session so audio is cleaned before STT -> Gemini ingestion.
2. Ensure you do not also enable other upstream noise suppression (e.g., krisp on the SIP trunk) to avoid double processing.
If you’re using SIP/telephony (short answer):
1. Install the same plugin as above.
2. Use BVCTelephony() for audio input options so the filter is appropriate for telephony audio.
3. Disable any telephony-side noise suppression (krisp) to avoid double suppression.
If you have a mixed environment:
• Dynamically choose the filter per participant: use BVC() for WebRTC participants and BVCTelephony() for SIP participants when you configure `room_options`/`audio_input` for each session.
What I can provide next once you confirm:
• A short copy-paste code snippet in your language (Python/Node) showing exactly where to set BVC() or BVCTelephony() in the agent start flow.
• Guidance on testing/validation (how to verify the noise cancellation is improving STT quality for Gemini).
• Troubleshooting tips if you notice artifacts or doubled suppression.
Which connection type are you using (WebRTC, SIP, or both)? Also tell me which language/runtime your agent runs in (Python or Node) and I’ll give the exact snippet you can drop into your code.
Sources: Choosing the right noise cancellation for your agent | LiveKit | Google AI and LiveKit | LiveKit Documentation | sip | livekit/livekit_composite | DeepWiki | Turns overview | LiveKit Documentationrapid-hamburger-23505
02/15/2026, 1:52 PMtall-airline-16756
02/15/2026, 1:52 PMBVC() for WebRTC participants (full-bandwidth).
◦ BVCTelephony() for SIP/telephony participants (narrowband).
• Disable any other noise-suppression on the SIP trunk (e.g., krisp) to avoid double suppression artifacts.
• Test and tune on representative calls to verify STT/Gemini quality.
Installation
• Add the plugin package:
◦ uv (uVenv) command:
uv add "livekit-plugins-noise-cancellation~=0.2"
Python example
• This shows dynamically selecting the right filter per participant when starting the agent session:
from livekit import rtc
from livekit.agents import AgentSession, room_io
from livekit.plugins import noise_cancellation
# inside your session setup / participant join handler
participant = await ctx.wait_for_participant() # wait for participant to join
# choose filter by participant kind
filter = (
noise_cancellation.BVCTelephony()
if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP
else noise_cancellation.BVC()
)
await session.start(
room=ctx.room,
agent=Assistant(),
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(noise_cancellation=filter)
),
)
Node (JavaScript / TypeScript) example
• Equivalent logic for Node agents:
const { rtc } = require("livekit");
const { AgentSession, room_io } = require("livekit/agents");
const { noise_cancellation } = require("livekit-plugins-noise-cancellation");
// inside your participant join handler
const participant = await ctx.waitForParticipant();
const filter =
participant.kind === rtc.ParticipantKind.PARTICIPANT_KIND_SIP
? new noise_cancellation.BVCTelephony()
: new noise_cancellation.BVC();
await session.start({
room: ctx.room,
agent: new Assistant(),
roomOptions: new room_io.RoomOptions({
audioInput: new room_io.AudioInputOptions({ noiseCancellation: filter }),
}),
});
Key tuning & testing tips
• Test with noisy backgrounds representative of your users: music, café noise, overlapping voices.
• Verify STT input to Gemini: confirm lower error rates, fewer false triggers, and clearer transcription.
• If you hear artifacts (pumping/warbling), ensure SIP trunk-side noise suppression (krisp) is disabled — double suppression causes artifacts.
• If you still see issues on specific devices or networks, capture short audio samples from those cases and compare processed vs unprocessed audio to identify problems.
What I can provide next
• A drop-in example for your exact agent repo or framework if you paste the relevant start/session code.
• A short checklist for validating STT/Gemini quality after enabling the filters.
• Troubleshooting steps and logs to collect if you see artifacts after enabling filters.
Would you like the drop-in snippet adapted to a specific file in your codebase or the validation checklist next?rapid-hamburger-23505
02/15/2026, 1:53 PMtall-airline-16756
02/15/2026, 1:54 PMuv add "livekit-plugins-noise-cancellation~=0.2"
Drop-in Python example
• Place this in your agent session/participant handler where you start the agent session. It chooses BVC() for WebRTC participants and BVCTelephony() for SIP participants, then starts the session with the selected filter.
from livekit import rtc
from livekit.agents import AgentSession, room_io
from livekit.plugins import noise_cancellation
class Assistant:
# Your assistant implementation here
pass
async def handle_participant(ctx, session: AgentSession):
"""
ctx: context provided by your agent runtime that includes the room and participant events
session: your AgentSession instance
"""
# Wait for a participant to join (example API - adapt to your runtime)
participant = await ctx.wait_for_participant()
# Select the appropriate noise cancellation filter
nc_filter = (
noise_cancellation.BVCTelephony()
if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP
else noise_cancellation.BVC()
)
# Start the agent session with the chosen noise cancellation filter applied to audio input
await session.start(
room=ctx.room,
agent=Assistant(),
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(noise_cancellation=nc_filter)
),
)
Notes and best practices
• Use BVC() for WebRTC (full-band audio) and BVCTelephony() for SIP (narrowband telephony).
• Disable upstream SIP/trunk-side noise suppression (e.g., krisp) to avoid double-processing and artifacts.
• Noise cancellation runs with very low latency (<10ms) and filters audio before STT/Gemini ingestion to improve transcription quality.
• If you hear artifacts (warbling or pumping), check for double suppression and test with different background noises.
Quick validation checklist
• Record short samples of noisy inputs (café noise, music, overlapping voices) with and without the filter enabled.
• Compare STT/transcription accuracy and error rates sent to Gemini.
• Confirm no audible artifacts; if artifacts appear, ensure SIP-side suppression is disabled and re-test.
If you want, I can adapt this snippet to the exact file structure of your project — paste the relevant start/session code or the function where you handle participants and I’ll give a drop-in edit.