How to set a fixed participant for agent audio processing
Learn how to configure your LiveKit agent to process audio from a specific participant in multi-participant rooms.
Last Updated:
When using an agent with LiveKit rooms containing multiple participants, you can specify which participant's audio track the agent should process for speech-to-text (STT) conversion.
Setting a Fixed Participant
Use the RoomIO constructor to specify a fixed participant identity when initializing your agent session:
session = AgentSession(llm=openai.realtime.RealtimeModel())
room_io = RoomIO(session, room=ctx.room, participant="participant-identity")
await room_io.start()await session.start(agent=MyAgent())
Note:
RoomIOis automatically used whenever an agent interacts with a LiveKit room. If you don't explicitly create aRoomIOinstance, a default one will be created when callingsession.start(agent, room=room).
By setting the participant parameter in the RoomIO constructor, the agent will only process audio from the specified participant identity, rather than switching between different participants in the room.
When to Use This
Setting a fixed participant is useful in scenarios such as:
- Dedicated support agents: When your agent should only respond to a specific caller in a multi-party room
- Interview applications: Where the agent should transcribe only the interviewee's speech
- Moderated rooms: Where certain participants have priority for agent interaction
Additional Resources
For more examples and advanced implementations, refer to our voice agents examples repository.