Repository navigation
Conversation
Adds a "Record each side separately" toggle that captures the uplink (your mic) and downlink (the other party) as two independent, time-synced files instead of one mixed recording, so each speaker can be clearly attributed for transcription. Assisted-by: Claude
R2bEEaton
force-pushed
the
feature/dual-track-recording
branch
from
July 22, 2026 18:54
64423c7 to
5a67e77
Compare
Author
|
Apologies — I should have opened an issue first to discuss this before submitting a PR, per the contributing guidelines (large features should be discussed before the work is done). Closing this for now; I'll open an issue instead so we can discuss the approach first. |
4 tasks done
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.
Summary
Adds a "Record each side separately" toggle (Settings -> Audio configuration) that captures the uplink (your mic) and downlink (the other party) as two independent, time-synced files instead of one mixed recording, e.g.
call_..._uplink.opus+call_..._downlink.opus.ShellServicenow runs a second, independentShellAudioPipelineinstance behind two new AIDL methods (startSecondaryRecording/stopSecondaryRecording), so a secondscrcpy-serverprocess (voice-call-downlink) runs concurrently alongside the existing one (voice-call-uplink), each with its own socket/pipe.AudioRecordingEnginewas reworked around a privateTrackSessionbundle so it can drive one (normal) or two (dual-track) capture pipelines in parallel, with symmetric start/rollback/teardown for both.ScrcpyAudioMuxeraccepts an optional shared wall-clock origin so both files' PTS=0 line up to the exact same instant, keeping the two tracks in sync for downstream processing.RecordingFileNameFormattergained an optional filename suffix (_uplink/_downlink) to distinguish the two outputs.Why this matters
Today, recording both sides of a call only produces one mixed file (
VOICE_CALL), or a single-sided file (VOICE_CALL_UPLINK/VOICE_CALL_DOWNLINK) if you pick one manually — there's no way to get both sides at once without them being mixed together. For transcription workflows, a mixed track makes speaker attribution unreliable (diarization heuristics), whereas two separate, perfectly-synced mono files make "who said what" deterministic: it's just "which file". This mirrors how call-center transcription products (e.g. Twilio/Deepgram dual-channel) typically separate speakers.Two files (rather than one file with two audio tracks) was chosen deliberately: Android's
MediaMuxeronly supports a single audio track per OGG container, so a true single-file two-track approach would only work for AAC/MP4, not Opus. Two mono files work identically for both codecs, need no new audio pipeline stage, and can still be losslessly combined into one stereo file afterward with a singleffmpegcommand (documented indocs/configuration.md) if a specific transcription API requires that shape instead.Testing
_uplink/_downlinksuffixes, both playable, both non-empty, both starting from the same wall-clock instant).scrcpy-serverprocess and no partial/locked output file../gradlew assembleDebugbuild passes with no new warnings from the changed files.This is additive and off by default; existing single-track recording behavior is unchanged when the toggle is off.