r
hi
✅ 1
t
Thanks for reaching out, Aaryan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi — thanks for reaching out! How can I help you today? If you have an issue, please share a brief description (e.g., error message, room ID, project ID, SDK/language, or steps to reproduce) and I’ll help you from there. , with interactive elements
r
any model for noise cancellation - like we have for EOU detection that I use already in livekit so noise cancelllation model also there?
t
Thanks — I’m responding to your question about whether LiveKit has a noise‑cancellation model like the EOU detection model you already use. Yes — LiveKit provides noise cancellation models you can use at the agent level. Options include: • NC() — removes common background noise (typing, traffic, HVAC). • BVC() (Background Voice Cancellation) — removes background noise and non‑primary speakers (good for improving STT accuracy for a single speaker). • BVCTelephony() — optimized for telephony/SIP (narrowband 8 kHz audio). Notes: • These run locally on the agent with minimal added latency (typically <10 ms). • Don’t run multiple cancellers simultaneously (for example, NC + BVC) to avoid double‑processing and reduced audio quality. • LiveKit Cloud also supports Krisp for SIP trunks via a
krisp_enabled
flag; disable Krisp if you’re using agent‑side noise cancellation to avoid double processing. If you want, tell me which SDK/language and participant types you’re using (WebRTC, SIP, or both) and I’ll show the exact code snippet to enable the right model. Sources: Choosing the right noise cancellation for your agent | LiveKit | Agents telephony integration | LiveKit Documentation | LiveKit Platform | Build, run, and observe voice AI agents | LiveKit | Sequential Pipeline Architecture for Voice Agents | LiveKit | Google AI and LiveKit | LiveKit Documentation, with interactive elements
r
Copy code
- SDK: Python livekit-agents (v1.2.9+) + livekit-api + livekit-rtc                                                                                                                                            
  - Agent: AgentSession / WorkerOptions based voice pipeline agent (named "exotel-voice-agent")                                                                                                                 
  - Participants: SIP (inbound trunks from Exotel) + WebRTC (room connections with published audio tracks)
t
Thanks — I’m responding to your request for implementation guidance for noise cancellation in your Python voice pipeline with SIP + WebRTC participants. Below are concise, practical steps and a Python example showing how to select and attach the appropriate noise cancellation filter per participant kind in a Worker/AgentSession pipeline. Key points • Use
BVC()
for full‑bandwidth WebRTC participants. • Use
BVCTelephony()
for SIP (8 kHz telephony) participants. • Don’t apply multiple cancellers (or cloud Krisp) at the same time — disable Krisp for trunks if using agent‑side cancellation. • These run locally and add minimal latency. Example (Python, within your Agent/Worker pipeline)
Copy code
from livekit_agents import noise_cancellation, rtc, pipeline

def select_noise_filter(participant):
    # participant.kind is an rtc.ParticipantKind
    if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP:
        return noise_cancellation.BVCTelephony()
    else:
        return noise_cancellation.BVC()

class MyVoiceAgent(pipeline.Agent):
    async def on_participant_join(self, participant):
        # choose filter based on participant type
        filter = select_noise_filter(participant)

        # attach filter to the participant's audio processing chain
        # (example API — adapt to your pipeline setup)
        participant.audio_pipeline.add_filter(filter)

        # optional: log or store which filter was applied
        print(f"Applied {filter.__class__.__name__} to participant {participant.sid}")

    # rest of agent implementation...
Configuration tips • If you have SIP trunks with LiveKit Cloud and
krisp_enabled
set, turn that off when using agent-side BVC/BVCTelephony to avoid double-processing. • Test with representative audio (typing, multi-speaker background) and compare STT results with and without the filter to confirm gain in accuracy. • If you route both SIP and WebRTC into a single pipeline, ensure you branch per participant kind early so the right filter is used. If you’d like, I can: • Give an exact snippet matching your AgentSession / WorkerOptions APIs (share the relevant pipeline code or how you currently attach plugins), or • Suggest test cases and metrics to validate improvements (e.g., WER, EOU detection latency)., with interactive elements
r
but I use exotel 8KHz and self hosted, so then what are my noise cancellation options?
t
Thanks — I’m responding about noise cancellation options for your self‑hosted Exotel 8 kHz SIP trunks. Recommendations • Use BVCTelephony() for Exotel 8 kHz telephony audio — it’s optimized for narrowband (8 kHz) audio and removes background noise while preserving telephony characteristics. • Do not use full‑band BVC() for 8 kHz SIP audio — that’s tuned for WebRTC/full‑band audio. • If you previously enabled Krisp on LiveKit Cloud, keep it disabled for these trunks to avoid double processing. Practical example (Python)
Copy code
from livekit_agents import noise_cancellation, rtc

def select_noise_filter(participant):
    if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP:
        return noise_cancellation.BVCTelephony()
    else:
        return noise_cancellation.BVC()
Best practices • Apply the filter per participant as early as possible in your pipeline. • Test with representative 8 kHz recordings (background typing, multi‑speaker rooms) and measure STT quality and latency. • Don’t run multiple cancellers simultaneously; one appropriate filter per stream is best. If you want, share how you attach filters in your AgentSession/WorkerOptions and I’ll provide the exact snippet to insert BVCTelephony into your pipeline. , with interactive elements
r
is BVCTelephony() only not for cloud?
t
Thanks — I’m responding to whether
BVCTelephony()
is limited to self‑hosted setups. No —
BVCTelephony()
is not cloud‑only or self‑hosted‑only. It’s a telephony‑optimized noise cancellation model intended for 8 kHz SIP/telephony audio and runs locally on the agent regardless of deployment (self‑hosted agent or an agent running in LiveKit Cloud). Use
BVCTelephony()
for narrowband SIP streams and
BVC()
for full‑band WebRTC streams, and avoid running multiple cancellers (or Krisp) on the same stream to prevent double‑processing. , with interactive elements