-
Notifications
You must be signed in to change notification settings - Fork 12
New audio track #188
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
New audio track #188
Conversation
|
Warning Rate limit exceeded@tbarbugli has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 54 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe AudioStreamTrack class transitions from an async queue-based architecture to an internal byte buffer for managing PCM data. The refactor introduces buffer overflow handling with a configurable maximum duration, timestamp-based frame pacing, and a new constructor parameter Changes
Sequence DiagramsequenceDiagram
participant Client
participant AudioStreamTrack
participant Buffer
participant Frame
Note over AudioStreamTrack,Buffer: New Buffering Architecture
Client->>AudioStreamTrack: write(pcm_data)
activate AudioStreamTrack
AudioStreamTrack->>AudioStreamTrack: _normalize_pcm()
Note over AudioStreamTrack: Convert format/rate/channels
AudioStreamTrack->>Buffer: append bytes (with lock)
alt Buffer overflow
Buffer->>Buffer: drop oldest data
Buffer->>AudioStreamTrack: log overflow
end
deactivate AudioStreamTrack
Client->>AudioStreamTrack: recv()
activate AudioStreamTrack
AudioStreamTrack->>Buffer: read from buffer (with lock)
alt Data available
Buffer-->>AudioStreamTrack: byte chunk
AudioStreamTrack->>Frame: fill AudioFrame planes
else Buffer empty
AudioStreamTrack->>Frame: emit silence (20ms)
end
AudioStreamTrack-->>Client: AudioFrame
Note over AudioStreamTrack: Timestamp-based pacing
deactivate AudioStreamTrack
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
getstream/video/rtc/audio_track.py(6 hunks)tests/test_audio_stream_track.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
getstream/video/rtc/audio_track.py (1)
getstream/video/rtc/track_util.py (5)
PcmData(87-1353)to_bytes(566-601)duration_ms(267-269)resample(542-564)resample(1392-1448)
tests/test_audio_stream_track.py (2)
getstream/video/rtc/audio_track.py (4)
AudioStreamTrack(15-264)write(83-148)recv(161-243)flush(150-159)getstream/video/rtc/track_util.py (5)
PcmData(87-1353)AudioFormat(29-79)kind(1675-1676)readyState(1683-1684)append(709-832)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Tests (3.12)
- GitHub Check: Tests (3.13)
- GitHub Check: Tests (3.10)
- GitHub Check: Tests (3.11)
Summary by CodeRabbit
Breaking Changes
max_queue_sizeparameter withaudio_buffer_size_ms(default 30000ms) for improved buffer management controlTests