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:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user