Add voice recording

Tools > Start Recording / Start Multitrack Recording / Stop Recording
record what is heard on the server, our own voice included, into Ogg
Opus, and publish client_is_recording. A plain recording mixes everyone
down to mono; a multitrack one gives each speaker (by unique id) an
uncoupled mono stream of their own under channel mapping family 255,
named in the tags after their nickname when the recording started,
silent until they first speak, and continuing into name-2.ogg past 255
speakers. Tracks are spooled beside the output and muxed on stop, since
the header carries the channel count.

The status bar shows a label that stops the recording; the existing
recording hotkeys start one straight into the last-used folder.
OggOpusFile now shares the new Ogg page writer and Opus header code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 14:57:51 +00:00
co-authored by Claude Opus 5.5
parent 93e0b36083
commit dc413f4975
26 changed files with 1721 additions and 94 deletions
@@ -44,6 +44,20 @@ class VoiceStreamTest {
assertEquals(List.of(true), talk);
}
@Test
void tapHearsTheSpeakerInMonoAtFullVolume() {
List<Float> tapped = new ArrayList<>();
stream.setTap((clientId, mono, frames) -> {
assertEquals(7, clientId);
assertEquals(VoiceFormat.FRAME_SIZE, frames);
tapped.add(mono[frames - 1]);
});
stream.offer(0, CodecType.OPUS_MUSIC, FakeOpus.packet(40));
stream.pull(out, 2, 0.5);
assertEquals(0.2f, out[1]);
assertEquals(List.of(0.4f), tapped);
}
@Test
void concealsALostPacket() {
offer(0, 1);