Skip to content

feat(room-io): listen to several participants through one audio input - #6884

Open
Darshak03 wants to merge 1 commit into
livekit:mainfrom
Darshak03:feat/multi-participant-audio-input
Open

feat(room-io): listen to several participants through one audio input#6884
Darshak03 wants to merge 1 commit into
livekit:mainfrom
Darshak03:feat/multi-participant-audio-input

Conversation

@Darshak03

Copy link
Copy Markdown

A single AgentSession could only ever hear the linked participant, so a room with two humans in it produced a one-sided chat context.

The composition point is an AudioInput rather than RoomIO: _RoomAudioInput is what RoomIO drives, and _ParticipantAudioInputGroup holds one unchanged _ParticipantAudioInputStream per participant. AudioInputOptions.participants selects how they are combined:

  • "linked" (default): unchanged, a single participant stream.
  • "mix": summed by rtc.AudioMixer, keeps overlapping speech.
  • "pick": only the participant the server reports as speaking, preceded by
    their held pre-roll and separated by a silence gap.

RoomIO keeps owning the participant lifecycle and routes it through add_participant/remove_participant, which do nothing for an input that only listens to the linked participant. participant_identity and set_participant still choose the linked participant, which now only drives the outputs.

Mixing an idle stream would pace the mix below real time and warn on every block, so a participant is registered with the mixer only while a live, unmuted track is being read: _ParticipantInputStream now reports when that changes, including a track that stops delivering without being unpublished.

A single AgentSession could only ever hear the linked participant, so a room
with two humans in it produced a one-sided chat context.

The composition point is an AudioInput rather than RoomIO: `_RoomAudioInput` is
what RoomIO drives, and `_ParticipantAudioInputGroup` holds one unchanged
`_ParticipantAudioInputStream` per participant. `AudioInputOptions.participants`
selects how they are combined:

- "linked" (default): unchanged, a single participant stream.
- "mix":    summed by `rtc.AudioMixer`, keeps overlapping speech.
- "pick":   only the participant the server reports as speaking, preceded by
            their held pre-roll and separated by a silence gap.

RoomIO keeps owning the participant lifecycle and routes it through
`add_participant`/`remove_participant`, which do nothing for an input that only
listens to the linked participant. `participant_identity` and `set_participant`
still choose the linked participant, which now only drives the outputs.

Mixing an idle stream would pace the mix below real time and warn on every
block, so a participant is registered with the mixer only while a live, unmuted
track is being read: `_ParticipantInputStream` now reports when that changes,
including a track that stops delivering without being unpublished.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant