try to run denoising

This commit is contained in:
2025-10-25 18:15:26 -06:00
parent cfb8144561
commit 260decc9af
7 changed files with 261 additions and 42 deletions
+13 -1
View File
@@ -29,7 +29,11 @@ use tracing::debug;
use tracing::error;
use tracing::info;
use crate::effects::AudioProcessor;
use crate::imp::AudioSystem;
pub mod app;
mod effects;
pub mod imp;
mod msghtml;
@@ -161,7 +165,7 @@ pub async fn network_loop<R: imp::ImpRead, W: imp::ImpWrite>(
match command {
Some(Command::Disconnect) => break,
Some(command) => {
let res = accept_command(command, &mut send_chan);
let res = accept_command(command, &mut send_chan, &mut audio);
if let Err(err) = res {
info!("error accepting command {:?}", err)
}
@@ -179,6 +183,7 @@ pub async fn network_loop<R: imp::ImpRead, W: imp::ImpWrite>(
fn accept_command(
command: Command,
send_chan: &mut UnboundedSender<ControlPacket<mumble_protocol::Serverbound>>,
audio: &mut AudioSystem,
) -> Result<(), Error> {
use Command::*;
let Some(session) = STATE.server.read().session else {
@@ -280,6 +285,13 @@ fn accept_command(
let _ = send_chan.unbounded_send(u.into());
}
Connect { .. } | Disconnect => (),
UpdateMicEffects { denoise } => {
if denoise {
audio.set_processor(AudioProcessor::new_denoising());
} else {
audio.set_processor(AudioProcessor::default());
}
}
}
Ok(())