Skip to content

v0.353.245

Choose a tag to compare

@github-actions github-actions released this 12 Sep 00:42
· 54 commits to trunk since this release

Capture both sides of a call into one stereo session file

The rest of phase 2. When gate 1 opens a session, capsper starts two captures
-- the microphone for the near end, the sink's monitor for the far end -- and
writes them interleaved into one file under a dated directory, near left and
far right.

One stereo file rather than two mono ones because channel separation is
lossless separation, so nothing is given up, and what is gained is a single
timeline. Two files have two, and if one capture starts a few tens of
milliseconds after the other, or takes a dropout, they desync and neither file
records that it happened.

Keeping that promise is the interleaver's whole job, and it is not free. The
two tracks are separate streams on separate pipes and stall independently: the
far end produces nothing at all while the sink is suspended, which is most of
a meeting where the near end is doing the talking. Emitting only what both
tracks have would let a stalled track back the other one up and, worse,
silently shift everything after the stall. So a track that falls more than a
second behind is padded with silence: the file keeps real time, and a stall
costs a little silence in the right place rather than a drift in every
timestamp after it. That logic is pure and unit-tested; the runner beside it
is only I/O.

Audio is appended as it is captured, with the header rewritten on close,
because an hour of stereo is 230 MB and a session lost to a kill is a session
that never happened.

AudioCapture now takes options rather than two positional arguments, which is
what carries stream.capture.sink through to the far-end stream. The test
measures the two channels in the played tone's own narrow band rather than
overall level, because that is the only way to catch the failure that matters:
without that property the stream silently records the microphone, and a far
track that is a second copy of the near one looks perfectly healthy by every
broadband measure.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01QymUVymc5GU948bExFSzsB