The default carrier media rate: G.711 μ-law at 8 kHz, the PSTN rate Twilio/Vonage carry. Realtime
models speak PCM16 at a higher rate (e.g. OpenAI 24 kHz, Gemini 16 kHz in / 24 kHz out), so
BaseTelephonyBridge resamples between the carrier rate and the model's rate on BOTH legs.
Skipping this plays the audio at the wrong rate — e.g. 24 kHz samples emitted as 8 kHz are ~3× slow and
pitched down ("deep").
Not every carrier is 8 kHz: a SIP/RTP leg negotiated as OPUS/16000 (e.g. the RingCentral softphone) is
wideband 16 kHz. Such drivers override the per-call rate via CARRIER_SAMPLE_RATE_CONFIG_KEY;
this constant remains the default when that key is absent, so the 8 kHz carriers are unaffected.
The default carrier media rate: G.711 μ-law at 8 kHz, the PSTN rate Twilio/Vonage carry. Realtime models speak PCM16 at a higher rate (e.g. OpenAI 24 kHz, Gemini 16 kHz in / 24 kHz out), so BaseTelephonyBridge resamples between the carrier rate and the model's rate on BOTH legs. Skipping this plays the audio at the wrong rate — e.g. 24 kHz samples emitted as 8 kHz are ~3× slow and pitched down ("deep").
Not every carrier is 8 kHz: a SIP/RTP leg negotiated as OPUS/16000 (e.g. the RingCentral softphone) is wideband 16 kHz. Such drivers override the per-call rate via CARRIER_SAMPLE_RATE_CONFIG_KEY; this constant remains the default when that key is absent, so the 8 kHz carriers are unaffected.