Fix WebRTC alignment and RN volume on LiveKit voice sessions - #813
Open
nathanpogue6 wants to merge 5 commits into
Open
Fix WebRTC alignment and RN volume on LiveKit voice sessions#813nathanpogue6 wants to merge 5 commits into
nathanpogue6 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 304c2ef. Configure here.
Reorder guards so isValidSocketEvent narrows before accessing audio_event, fixing client tsc build in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
|
@nathanpogue6 do you know if this is a regression or if it just never worked? |
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.

Fixes WebRTC/LiveKit voice sessions dropping
audio_event.alignmenton the data channel (playback correctly uses LiveKit tracks, but timing data is needed for karaoke highlighting). Alignment-only audio events are now forwarded toonAudioAlignmentwithout playback payload. Stale alignment after barge-in is ignored using the same interruptevent_idguard as onAudio. React NativesetVolumenow applies to LiveKit remote audio tracks when no web audio adapter is present. WebSocket voice is unchanged; tests cover LiveKit, WebSocket, and interrupt behavior.Note
Medium Risk
Touches real-time voice event handling and WebRTC data-channel filtering; behavior is well covered by new tests but affects karaoke/alignment UX and RN volume on LiveKit sessions.
Overview
Fixes LiveKit/WebRTC voice sessions dropping character alignment on the data channel while playback still uses remote audio tracks.
WebRTCConnectionnow forwards alignment-onlyaudioevents (emptyaudio_base_64) and ignores audio data messages without alignment.VoiceConversation.handleAudioapplies the same interruptevent_idguard toonAudioAlignmentas to playback callbacks, so stale alignment after barge-in is ignored. Alignment-only events no longer triggeronAudio, mode changes, or feedback updates.On platforms without a web audio adapter (e.g. React Native), output volume is applied via LiveKit
RemoteAudioTrack.setVolume, with remote tracks tracked through subscribe/unsubscribe lifecycle.New tests cover WebRTC data channel behavior, WebSocket alignment forwarding, interrupt staleness, and LiveKit volume fallback.
Reviewed by Cursor Bugbot for commit 158e536. Bugbot is set up for automated code reviews on this repo. Configure here.