M2: tsc-audio, tsc-store and tsctl voice

- tsc-audio: Opus voice/music encoder producing TeamSpeak voice packets,
  framer, rubato resampling, WAV I/O, tone/Goertzel helpers, cpal
  capture/playback over lock-free ring buffers; the vendored
  AudioHandler is the jitter buffer/mixer.
- tsc-store: SQLite (bundled, WAL, 0600) with migrations for identities,
  bookmarks, settings and paged chat history; Secrets trait with memory
  and OS keyring backends.
- tsctl voice send (WAV or tone, real time) / record (mix to WAV,
  --expect-tone check). The smoke test now includes a voice round-trip:
  1 kHz tone ratio ~0.95 on TS3 and TS6.
- Dev profile: no debug info for dependencies (target/ 16 GB -> 2.4 GB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
Claude committed 2026-09-25 13:56:01 +00:00
1 parent 301a543c5e
commit 90e05723da
20 files changed
+2379 -35

No files matched your search

+34
View File
@@ -4,6 +4,7 @@ mod identity;
mod session;
mod tree;
mod versions;
mod voice;
use std::path::PathBuf;
use std::time::Duration;
@@ -116,10 +117,43 @@ pub enum Action {
/// Send a raw, already escaped command (e.g. `serveredit virtualserver_name=Test\\sServer`)
/// and wait for the result. Combine with `--log-commands` to see the answer.
Raw { command: String },
/// Send or record voice in the current channel.
Voice {
#[command(subcommand)]
command: VoiceCommand,
},
/// Interactive session. Type `/help` for commands.
Repl,
}
#[derive(Subcommand, Debug, Clone)]
pub enum VoiceCommand {
/// Talk: send a WAV file or a test tone, in real time.
Send {
/// WAV file to send (any sample rate; resampled to 48 kHz).
file: Option<PathBuf>,
/// Send a sine tone of this frequency instead of a file.
#[arg(long, conflicts_with = "file")]
tone: Option<f32>,
/// Tone length in seconds.
#[arg(long, default_value_t = 3.0)]
seconds: f32,
/// Use the stereo Opus Music codec instead of mono Opus Voice.
#[arg(long)]
music: bool,
},
/// Listen: mix everything said in the channel into a stereo 48 kHz WAV file.
Record {
out: PathBuf,
/// Recording length in seconds.
#[arg(long, default_value_t = 5.0)]
seconds: f32,
/// Fail unless the recording contains this tone frequency (for tests).
#[arg(long)]
expect_tone: Option<f32>,
},
}
#[derive(Subcommand, Debug, Clone)]
pub enum ChatTarget {
/// Send to the server chat (everyone on the server).