Fully configure frame processors when they are used directly on an audio stream#679
Open
1egoman wants to merge 20 commits into
Open
Fully configure frame processors when they are used directly on an audio stream#6791egoman wants to merge 20 commits into
1egoman wants to merge 20 commits into
Conversation
…io stream And extracting metadata from that room that can be fed into the frame processor.
3e5a9ab to
f62c247
Compare
…oStream This makes it less complex.
The agents sdk can pass this opt-out flag so that it can reuse the frame processor across many audio tracks
Need to think about this a bit more, this pattern as written won't work, since the FrameProcessor today can't have a set of no-op credentials pushed.
1egoman
commented
May 26, 2026
…Processor methods, and use them when moving a track out of a room
564b2c7 to
8d3f4fe
Compare
These tests exercise all the frame processor track reparenting under room / etc paths.
3 tasks
theomonnom
reviewed
May 27, 2026
| num_channels: int = 1, | ||
| frame_size_ms: int | None = None, | ||
| noise_cancellation: Optional[NoiseCancellationOptions | FrameProcessor[AudioFrame]] = None, | ||
| noise_cancellation_leave_open: bool = False, |
Member
There was a problem hiding this comment.
Suggested change
| noise_cancellation_leave_open: bool = False, |
Can we move that inside NoiseCancellationOptions?
Contributor
Author
There was a problem hiding this comment.
Unfortunately, no - this also important to the FrameProcessor[AudioFrame] side of that noise_cancellation union. Open to putting it somewhere else but it needs to be settable in the FrameProcessor path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the python sdk so that
FrameProcessor-based noise cancellation providers can be used directly onAudioStream, without having to go through the agent's RoomIO to be able to initialize itself with credentials.For example, with this change, something like the below becomes possible:
The way this works -
Tracks now keep track of which room they are part of (holding aweakrefvalue). When the room a track is in changes, it computes new frame processor options and sends these to anyAudioStreams which are associated with the track.The
noise_cancellation_leave_openparameter allows the agents sdk to call thisfrom_trackmethod with a frame processor which remains open across the whole session, and won't be auto-closed when the track is closed.This goes along with livekit/agents#5867, which removes the relevant event handling logic in the agents sdk. I will follow up with a node version of this once the python one is in a good state.
Todo