Skip to content

Conversation

@lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Dec 2, 2025

No description provided.

Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

T = TypeVar("T", bound=Union[AudioFrame, VideoFrame])


class FrameProcessor(Generic[T], ABC):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): This might be over abstracting, but we could make this more generalizable by defining an AuthenticatedFrameProcessor interface which inherits from a more general FrameProcessor one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, we can always go the other way around later with an Unauthenticated... (not that name, but something better) that stubs out the setCredentials call.

num_channels: int = 1,
frame_size_ms: int | None = None,
noise_cancellation: Optional[NoiseCancellationOptions] = None,
noise_cancellation: Optional[NoiseCancellationOptions | FrameProcessor[AudioFrame]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have another field name than noise_cancellation?
Like just processors?

Comment on lines +19 to +34
def _update_stream_info(
self,
*,
room_name: str,
participant_identity: str,
publication_sid: str,
): ...

@abstractmethod
def _update_credentials(self, *, token: str, url: str): ...

@abstractmethod
def _process(self, frame: T) -> T: ...

@abstractmethod
def _close(self): ...
Copy link
Member

@theomonnom theomonnom Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need those methods (e.g: _update_credentials) ? Seems like an implementation detail?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking this interface could be used by anybody, more like a general purpose API

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the underlying Rust implementation would need to make calls to _update_credentials when tokens have refreshed.. this is the same thread as jacob's comment

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg

owned_buffer_info = audio_event.frame_received.frame
frame = AudioFrame._from_owned_info(owned_buffer_info)
if self._processor is not None:
frame = self._processor._process(frame)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat.. this is clean

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.

6 participants