<@U07FRRZH2GN> how to handle the background noise ...
# ask-ai
f
@icy-policeman-64898 how to handle the background noise when on call, because the agent's latency increases dude to background noise
t
Thanks for reaching out, Abhishek. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I hear you: background noise is causing increased agent latency and you want practical ways to reduce it during calls. Below are clear steps you can take right away and why they help. What to use • Use Enhanced Noise Cancellation: ◦ For WebRTC calls, enable Background Voice Cancellation (BVC). ◦ For SIP/telephony (narrow-band 8 kHz), enable BVCTelephony. ◦ These filters remove ambient noise and non-primary speakers, which prevents false voice-activity detection and unnecessary STT/LLM processing. How to apply it (examples) 1. Python
Copy code
from livekit.plugins import noise_cancellation

filter = (
    noise_cancellation.BVCTelephony()  # for SIP calls
    if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP
    else noise_cancellation.BVC()      # for WebRTC
)
1. Node.js / TypeScript
Copy code
const filter = participant.kind === ParticipantKind.SIP
  ? TelephonyBackgroundVoiceCancellation()
  : BackgroundVoiceCancellation();
Apply the filter when starting the agent session so audio is cleaned before STT. Important cautions • Avoid double-processing: If you already run agent-side noise cancellation, set
krisp_enabled=False
on SIP trunks or client SDKs. Running two noise filters together can degrade audio and reduce STT accuracy. Why this reduces latency • Cleaner audio leads to faster, more reliable STT endpointing (less time spent detecting speech). • Reduces false triggers from background noise so the system avoids extra LLM calls or retries. • Improves transcription quality, which reduces reprocessing and perceived delays. Additional practical tips • Encourage users to speak in longer phrases rather than 1–3 word fragments; short utterances are harder to detect and can increase retry/latency. • If speech seems overly suppressed, temporarily disable the noise filter to verify it isn’t removing valid speech. • Always choose the telephony-optimized model (
BVCTelephony
) for SIP callers for best performance on narrow-band audio. If you’d like, tell me: • Are these calls WebRTC, SIP, or a mix? • Whether you already have any noise cancellation enabled (e.g., krisp) so I can suggest the exact setting changes. Sources: Choosing the right noise cancellation for your agent | LiveKit | Troubleshooting STT not picking up utterances | LiveKit