what sample rate do we get from twilio and is that...
# ask-ai
i
what sample rate do we get from twilio and is that defined anywhere in the livekit code
t
Thanks for reaching out, Ed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! I wanted to share that Twilio connections in LiveKit are limited to an 8kHz sample rate because Twilio doesn’t currently support HD voice. This is pretty standard for traditional telephony audio quality. On the bright side, LiveKit itself supports higher sample rates internally, like 48kHz for Opus audio processing, which helps maintain great audio quality. If you’re curious about the specific sample rate settings in the LiveKit code, here are a few key ones to keep in mind: •
DEFAULT_SAMPLE_RATE = 16000
for STT processing •
LIVEKIT_INPUT_SAMPLE_RATE = 48000
for LiveKit input •
DefaultOpusSampleRate = 48000
in the Go server SDK Please don’t hesitate to reach out if you’d like any more help with Twilio integration or handling sample rates—I’m here to help! Sources: HD voice for SIP | LiveKit Docs | livekit-agents/livekit/agents/voice/room_io/_pre_connect_audio.py | pkg/media/constants.go | stream_audio.py