Skip to content

Commit 15e318c

Browse files
committed
more progress on dtln denoise
1 parent b9a8434 commit 15e318c

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ cidre = { git = "https://github.com/yury/cidre", rev = "4f0eff4" }
171171
cpal = "0.15.3"
172172
dasp = "0.11.0"
173173
hound = "3.5.1"
174+
realfft = "3.4.0"
174175
rodio = "0.20.1"
175176

176177
kalosm-common = { git = "https://github.com/floneum/floneum", rev = "52967ae" }

crates/denoise/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ edition = "2021"
55

66
[dependencies]
77
hypr-onnx = { workspace = true }
8+
realfft = { workspace = true }

crates/denoise/src/lib.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
1+
use hypr_onnx::{load_model, ndarray, ort};
2+
13
const MODEL_1_BYTES: &[u8] = include_bytes!("../data/model_1.onnx");
24
const MODEL_2_BYTES: &[u8] = include_bytes!("../data/model_2.onnx");
5+
6+
pub struct DTLN {
7+
model_1: ort::session::Session,
8+
model_2: ort::session::Session,
9+
}
10+
11+
impl DTLN {
12+
pub fn new() -> Result<Self, ort::Error> {
13+
Ok(Self {
14+
model_1: load_model(&MODEL_1_BYTES)?,
15+
model_2: load_model(&MODEL_2_BYTES)?,
16+
})
17+
}
18+
19+
// https://github.com/breizhn/DTLN-aec/blob/main/run_aec.py
20+
pub fn process(&self, _input: &[f32]) -> Result<Vec<f32>, ort::Error> {
21+
Ok(vec![])
22+
}
23+
}
24+
25+
#[cfg(test)]
26+
mod tests {
27+
use super::*;
28+
29+
#[test]
30+
fn test_dtln() {
31+
let _dtln = DTLN::new().unwrap();
32+
}
33+
}

0 commit comments

Comments
 (0)