Hey, I am running into a weird audio quality issue...
# telephony
b
Hey, I am running into a weird audio quality issue with SIP calls and could use some help. Setup: • Twilio SIP trunk → LiveKit → OpenAI Realtime API • Python agents SDK • Using
openai.realtime.RealtimeModel
with
AgentSession
Problem: Sometimes (not always) the voice output sounds robotic/metallic or like voices are mixing together. The weird part - when I listen to Twilio's call recording, the audio sounds perfectly fine. So the issue seems to be in the LiveKit → Realtime API part, not the Twilio input. The voice can also suddenly slow down or change tone mid-conversation. It's really inconsistent which makes it hard to debug. Current config: python
Copy code
AgentSession(
    llm=openai.realtime.RealtimeModel(
        voice="alloy",
        temperature=0.1,
        model="gpt-4o-realtime-preview-2024-12-17"
    ),
    turn_detection="realtime_llm",
)

# Room input options
room_input_options=RoomInputOptions(
    noise_cancellation=noise_cancellation.BVCTelephony()
)
Questions: 1. Is
BVCTelephony()
noise cancellation recommended for SIP calls, or should I use something lighter/disable it? 2. Does the temperature setting on RealtimeModel affect voice quality? I've got it at 0.1 right now. 3. Any known issues with audio buffering between SIP and Realtime API that could cause this? The inconsistency is killing me - same setup, sometimes perfect audio, sometimes sounds like a robot. Any ideas what could be causing this? Thanks!
b
I have reported the same issue on outbound calls. Tried different telephony and tts and seems to make no difference. What I found strange during testing is that in the mornings (UK Time) it seems to be no problem why the evenings tend to demonstrate it. It might be circumstantial, or not.
I was also investigating HD Sound however, it is not available in the UK for telnyx
b
Temperature was the issue this time. It seems that temperature 0.1 is not good for this model.
🙌 1
b
very well