-
Notifications
You must be signed in to change notification settings - Fork 12
Cleanup PcmData constructors and populate participant in events #192
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
Conversation
WalkthroughChanges refactor PCM audio data handling to use numpy arrays exclusively, attach participant context directly to PCM objects rather than passing as tuples, simplify audio callbacks to accept only PCM data, and introduce helper utilities for centralized chunk processing and width calculations. Changes
Sequence DiagramsequenceDiagram
autonumber
participant Subscriber
participant AudioTrack as AudioTrackHandler
participant OldHandler as Old: Inline Lambda
participant NewHandler as New: _emit_pcm
participant Listener as Audio Listener
Note over Subscriber,Listener: Before (on_track lambda)
Subscriber->>AudioTrack: receive PCM chunk
AudioTrack->>OldHandler: emit(pcm, user)
OldHandler->>Listener: on_audio(pcm, user)
Note over Subscriber,Listener: After (_emit_pcm helper)
Subscriber->>AudioTrack: receive PCM chunk
AudioTrack->>NewHandler: _emit_pcm(pcm)
NewHandler->>NewHandler: pcm.participant = user
NewHandler->>Listener: on_audio(pcm)
Listener->>Listener: extract participant from pcm.participant
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (4)
🧰 Additional context used🧬 Code graph analysis (4)getstream/video/rtc/pc.py (1)
getstream/video/rtc/peer_connection.py (1)
getstream/video/rtc/track_util.py (1)
tests/rtc/test_pcm_data.py (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
from_numpy()method for audio data creation with improved validation and type handling.Refactor
Tests