Add per-peer listener-side noise gate
Let a listener apply a noise gate to an individual peer's incoming audio — "fix this person's noisy mic / background hum on my end" — which is only possible because full-mesh P2P keeps every peer's stream unmixed locally (server-mixed apps can't do per-listener per-peer DSP). The DSP is the existing mic NoiseGate reused verbatim: it already processes i16 frames at a fixed rate with hysteresis/attack/release/ hangover and takes the threshold per-frame. Wiring mirrors per-peer EQ: - AppConfig.peer_gate map (threshold per peer id; absent/0 = off), persisted, never sent over the wire - CoreCommand::SetPeerGate + Arc<Mutex<HashMap>> shared into the mixer - a live HashMap<EndpointId, NoiseGate> in the mixer task, created lazily and dropped when disabled (no rebuild needed — threshold is passed per frame) - Gate row (threshold slider, "Off" at zero) in each participant card next to Vol/Pan/EQ, persisting on release The gate runs on the raw decoded frame: after the clean multitrack stem tap (recordings stay ungated) but before volume/EQ, so the threshold tracks the peer's true signal level regardless of our volume setting. Same 0..METER_MAX scale as the mic gate. +2 unit tests (config helper); +1 config back-compat assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,10 @@ pub enum CoreCommand {
|
||||
SetPeerEq(EndpointId, crate::audio::eq::EqSettings),
|
||||
/// Listener-side per-peer pan. Local only; never leaves this app instance.
|
||||
SetPeerPan(EndpointId, f32),
|
||||
/// Listener-side per-peer noise gate threshold (normalized RMS, `0.0` = off).
|
||||
/// Applies the same smooth gate as the mic path to a peer's incoming audio,
|
||||
/// to suppress their background noise on our end. Local only.
|
||||
SetPeerGate(EndpointId, f32),
|
||||
/// Locally mute/unmute a peer: when muted, their audio is decoded (so levels
|
||||
/// still show) but not mixed into our output.
|
||||
SetPeerMuted(EndpointId, bool),
|
||||
|
||||
Reference in New Issue
Block a user