RustAudio / rnnoise-c

Rust bindings to Xiph's rnnoise denoising library
Other
7 stars 3 forks source link

Doesn't seem to be working #4

Closed est31 closed 4 years ago

est31 commented 4 years ago

If you do the following:

wget https://people.xiph.org/~jm/demo/rnnoise/samples/car_0dB.opus
ffmpeg -i car_0dB.opus -vn -ar 48000 -ac 1 -b:a 48000 car_0dB.wav
cargo run --example client -- --input car_0dB.wav --output car_0dBdn.wav

You get a car_0dBdn.wav that sounds basically the same as car_0dB.wav. Not sure why that's the case. We are using the builtin model, maybe it is not trained? IDK. cc @jmvalin @jeremyandrews .

Flakebi commented 4 years ago

I scaled the input floats by 65535, the input range in the C example code uses shorts as input so 0..65535 should be the best range. Then it works perfect!

est31 commented 4 years ago

Thanks for that idea! It now works indeed. I'm adding the conversion code to the sample.

est31 commented 4 years ago

Btw, c shorts are in the range of -32767..=32767... so one should rather multiply it by that number. It's working for you because it's only a factor of two difference in the amplitude which the model can obviously handle.