I have a session where a user and livekit agent ar...
# ask-ai
b
I have a session where a user and livekit agent are having conversation. I want to build a feature where another user can join the room and all the participants can talk to each other. Also the person can mute the bot. Is it possible?
t
Thanks for reaching out, Ranjeet. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to guide you through allowing multiple participants to join a LiveKit room and muting specific participants, like a bot. Here’s how you can do it step-by-step: 1. Allowing Multiple Participants: • Rooms are created automatically when the first participant joins, and there isn’t a default limit unless you set one. • If you'd like to set a participant limit, you can use the Room Service API to create a room with a
maxParticipants
value. 2. Muting Specific Participants: • You can mute a specific participant’s track by using the Room Service API’s
MutePublishedTrack
method. Here’s an example:
Copy code
// Mute a specific track from a participant
await roomService.mutePublishedTrack(
  'room-name',
  'participant-identity', // e.g., 'bot-identity'
  'track-sid',
  true // true to mute, false to unmute
);
• Just make sure you have
roomAdmin
permissions to do this. • If you want to allow remote unmuting, you’ll need to adjust your project settings in LiveKit Cloud or update your YAML configuration if you’re self-hosted. If you have any questions or need a hand with the implementation, please don’t hesitate to ask—I’m here to help! Sources: config-sample.yaml | examples/multiple_connections.py | protobufs/livekit_room.proto | livekit-api/src/services/room.rs | Managing participants | LiveKit Docs