is `session.input.set_audio_enabled` not worked i...
# ask-ai
l
is
session.input.set_audio_enabled
not worked in openai realtime api agent?
t
Thanks for reaching out, kaga. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just wanted to let you know that the
session.input.set_audio_enabled
method is totally supported and super handy for turning audio input on or off during a LiveKit agent session, even if you’re using the OpenAI Realtime API agent. You can easily switch audio input by passing a simple True or False, like this:
Copy code
session.input.set_audio_enabled(True)  # Enables audio input
session.input.set_audio_enabled(False)  # Disables audio input
Just a quick heads-up: make sure your session is set up to support audio input. If audio is turned off at the session level or if it’s set to text-only, this might not work quite right. If you want, I’m here to help with more examples or any other questions you have! Sources: examples/avatar_agents/bithuman/agent_cloud.py | Turn detection and interruptions | LiveKit Docs