8000 add user_data to AudioFrame by longcw · Pull Request #456 · livekit/python-sdks · GitHub
[go: up one dir, main page]

Skip to content

add user_data to AudioFrame #456

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
8 changes: 8 additions & 0 deletions livekit-rtc/livekit/rtc/audio_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(
self._sample_rate = sample_rate
self._num_channels = num_channels
self._samples_per_channel = samples_per_channel
self._userdata: dict[str, Any] = {}

@staticmethod
def create(sample_rate: int, num_channels: int, samples_per_channel: int) -> "AudioFrame":
Expand Down Expand Up @@ -100,6 +101,13 @@ def _proto_info(self) -> proto_audio.AudioFrameBufferInfo:
audio_info.samples_per_channel = self.samples_per_channel
return audio_info

@property
def userdata(self) -> dict[str, Any]:
"""
Returns the user data associated with the audio frame.
"""
return self._userdata

@property
def data(self) -> memoryview:
"""
Expand Down
Loading
0