feat: push-to-talk with mic capture and Opus encoding

Push-to-Talk:
- Hold V key to activate microphone
- cpal input stream captures mono 48kHz f32 samples
- Opus encoder (audiopus) encodes 20ms frames
- Encoded packets sent via SyncConnectionHandle -> con.send_audio()
- End-of-transmission packet sent on PTT release
- Microphone struct for mic lifecycle management
- OpusEncoderState with sample buffering and frame splitting

Audio:
- Replaced opus crate with audiopus (matches tsclientlib)
- Microphone start/stop with device selection
- PTT keyboard event subscription (V key hold/release)
- Audio gated behind 'audio' feature (needs ALSA/cmake)

69 tests passing, clippy clean on both audio and non-audio builds
This commit is contained in:
ReTeamSpeak
2026-05-13 10:54:58 +09:00
parent 61f2d5bdb6
commit 190fcf2a7e
3 changed files with 255 additions and 47 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ tracing = { workspace = true }
tracing-subscriber = { workspace = true }
chrono = { workspace = true }
cpal = { version = "0.15", optional = true }
audiopus = { version = "0.3.0-rc.0", optional = true }
shared = { workspace = true }
tscore = { workspace = true }
@@ -28,4 +29,4 @@ tsproto-packets = { workspace = true }
[features]
default = []
audio = ["dep:cpal"]
audio = ["dep:cpal", "dep:audiopus"]