how do i add noise cancellation for telephony to t...
# ask-ai
s
how do i add noise cancellation for telephony to this? model = openai.realtime.RealtimeModel( voice="shimmer", temperature=0.8, #model="gpt-4o-realtime-preview-2025-06-03", # Tell Whisper to expect Turkish (“tr”) audio _input_audio_transcription_=None, _turn_detection_=None, modalities=["text"] ) # Create AgentSession with the multimodal model session = AgentSession( llm=model, tts=elevenlabs.TTS( language=LANG_MODE, _voice_id_="cgSgspJ2msm6clMCkdW9", _streaming_latency_=3, ), vad=silero.VAD.load(), stt = deepgram.STT( model="nova-2-general", language=LANG_MODE, _sample_rate_=8000, # critical ), _#turn_detection=MultilingualModel(),_ )
t
Thanks for reaching out, Rhythm. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To add noise cancellation optimized for telephony audio (such as 8kHz streams) in your pipeline, use LiveKit's
BVCTelephony
noise cancellation model. This is specifically designed for telephony use cases and works well with STT, TTS, and VAD components. Installation:
Copy code
pip install "livekit-plugins-noise-cancellation~=0.2"
Integration (Agent-Level, recommended for your setup):
Copy code
from livekit.plugins import noise_cancellation

await session.start(
    # ...,
    room_input_options=room_io.RoomInputOptions(
        noise_cancellation=noise_cancellation.BVCTelephony(),
    ),
)
Alternative: AudioStream-Level Integration
Copy code
stream = rtc.AudioStream.from_track(
    track=track,
    noise_cancellation=noise_cancellation.BVCTelephony(),
)
• Use
noise_cancellation.BVCTelephony()
for best results with telephony audio. • Disable any client-side noise cancellation to avoid double processing. • This feature is available for LiveKit Cloud customers. The
BVCTelephony
model is optimized for telephony and will provide optimal noise suppression for your use case.