what is RoomInputOptions, can we change audio samp...
# ask-ai
s
what is RoomInputOptions, can we change audio sample rate using this??
t
Thanks for reaching out, Rahul. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking about RoomInputOptions and whether it can change audio sample rate — good question. RoomInputOptions configures how an agent receives media from a room (audio, video, text). It includes an
audio_sample_rate
setting you can change to set the incoming audio sample rate (Hz). Example in Python:
Copy code
input_options = RoomInputOptions(
  audio_sample_rate=16000  # sets audio sample rate to 16 kHz
)
If you want, tell me which SDK/language you're using and the target sample rate so I can give a matching code example. Sources: Agent session | LiveKit docs
s
ok, then what is the difference between
AudioInputOptions and RoomInputOptions
t
You're asking for the difference between
RoomInputOptions
and
AudioInputOptions
— good question. • RoomInputOptions ◦ Room-level, higher‑level config passed to
AgentSession.start()
to control how the agent receives all input from a room (audio, video, text). ◦ Includes broad audio settings like
audio_enabled
,
audio_sample_rate
, channels, noise cancellation, and room connection behavior. ◦ Use this when you want simple, direct configuration for an agent session. • AudioInputOptions ◦ Lower-level, audio-specific config used inside
room_options
(e.g.,
room_io.RoomOptions
). ◦ Allows finer-grained or conditional audio handling (for example, applying different noise cancellation depending on participant type). ◦ Use this when you need advanced or per-participant audio logic. If you tell me which SDK/language and the exact behavior you want (simple sample-rate change vs. conditional processing), I can show a short code example for that case. Sources: Agent session | LiveKit docs | Voice AI quickstart | LiveKit docs
s
so if the client wantto send audio in 16000 sample rate to the agent , where i nedd toa djust, is it in
RoomInputOptions or in AudioInputOptions
t
Set the incoming audio sample rate in RoomInputOptions. RoomInputOptions is the room-level setting that includes
audio_sample_rate
(Hz) for how the agent receives audio. AudioInputOptions is for more granular/conditional audio handling (noise cancellation, per-participant logic) and not where you set the global sample rate. Example (Python):
Copy code
input_options = RoomInputOptions(
  audio_enabled=True,
  audio_sample_rate=16000
)
session.start(room=ctx.room, agent=MyAgent(), room_input_options=input_options)
Do you need the same example for a specific SDK/language or for client-side capture settings?
s
if i setup audio_sample_rate=16000, then for client , at what samplerate it willget audio??
t
Setting
audio_sample_rate=16000
in
RoomInputOptions
controls the sample rate the agent receives audio at — the agent will get (or be resampled to) 16 kHz. The client’s capture/transmit sample rate is independent and is determined by the client SDK/browser (WebRTC clients typically capture at 48 kHz). LiveKit will resample as needed so the agent receives 16 kHz even if the client sent 48 kHz. If you need the agent-to-client (outbound) sample rate changed, that is controlled by
RoomOutputOptions.audio_sample_rate
(default 24000 Hz). Would you like an example for your SDK/language to show receive vs. send settings? Sources: Agent session | LiveKit docs | Processing raw media tracks | LiveKit docs