From 9686085eb79329333a9c6ba0c2743024e2fdf512 Mon Sep 17 00:00:00 2001 From: David Kleingeld Date: Mon, 15 Sep 2025 16:49:16 +0200 Subject: [PATCH] fixes incoming legacy voip stream not being resampled --- Cargo.lock | 20 +++++++++++++++++--- crates/audio/Cargo.toml | 2 +- crates/audio/src/audio.rs | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c756d66a6108b57fc3b25e033d213aa7960a0ebd..7b4ac224b991fd6ae81ffaf292ae6d4ad6acdd2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2678,9 +2678,10 @@ dependencies = [ [[package]] name = "candle-core" version = "0.9.1" -source = "git+https://github.com/dvdsk/candle?branch=9.1-patched#591d35bb503cb93a63bb49d5fe2d9531ee6ad651" +source = "git+https://github.com/dvdsk/candle?branch=add-operators#eb7ce1cb6a201400c9c5117bf1d041454768bb03" dependencies = [ "byteorder", + "float8", "gemm 0.17.1", "half", "memmap2", @@ -2699,10 +2700,11 @@ dependencies = [ [[package]] name = "candle-nn" version = "0.9.1" -source = "git+https://github.com/dvdsk/candle?branch=9.1-patched#591d35bb503cb93a63bb49d5fe2d9531ee6ad651" +source = "git+https://github.com/dvdsk/candle?branch=add-operators#eb7ce1cb6a201400c9c5117bf1d041454768bb03" dependencies = [ "candle-core", "half", + "libc", "num-traits", "rayon", "safetensors", @@ -2713,7 +2715,7 @@ dependencies = [ [[package]] name = "candle-onnx" version = "0.9.1" -source = "git+https://github.com/dvdsk/candle?branch=9.1-patched#591d35bb503cb93a63bb49d5fe2d9531ee6ad651" +source = "git+https://github.com/dvdsk/candle?branch=add-operators#eb7ce1cb6a201400c9c5117bf1d041454768bb03" dependencies = [ "candle-core", "candle-nn", @@ -5948,6 +5950,18 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d" +[[package]] +name = "float8" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4203231de188ebbdfb85c11f3c20ca2b063945710de04e7b59268731e728b462" +dependencies = [ + "half", + "num-traits", + "rand 0.9.1", + "rand_distr", +] + [[package]] name = "float_next_after" version = "1.0.0" diff --git a/crates/audio/Cargo.toml b/crates/audio/Cargo.toml index c52230e670ca1ec8e4b9ee15355787e6fab7619a..9635ba2a1f5c3655c05c8e5d9c76feff60e675be 100644 --- a/crates/audio/Cargo.toml +++ b/crates/audio/Cargo.toml @@ -17,7 +17,7 @@ anyhow.workspace = true async-tar.workspace = true collections.workspace = true crossbeam.workspace = true -denoise = { path = "/home/davidsk/Documents/denoise"} +denoise = { path = "/home/davidsk/Documents/denoise" } gpui.workspace = true log.workspace = true parking_lot.workspace = true diff --git a/crates/audio/src/audio.rs b/crates/audio/src/audio.rs index 1605e267c74a059ab2d2fcb022c42f0137c9718f..ee4bce6ea6e15a464667658ce05b578604ba2d7b 100644 --- a/crates/audio/src/audio.rs +++ b/crates/audio/src/audio.rs @@ -224,6 +224,7 @@ impl Audio { cx: &mut App, ) -> anyhow::Result<()> { let (replay_source, source) = source + .constant_params(CHANNEL_COUNT, SAMPLE_RATE) .automatic_gain_control(1.0, 2.0, 0.0, 5.0) .periodic_access(Duration::from_millis(100), move |agc_source| { agc_source.set_enabled(LIVE_SETTINGS.auto_speaker_volume.load(Ordering::Relaxed));