RustAudio / rnnoise-c

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

add an example #1

Closed jeremyandrews closed 4 years ago

jeremyandrews commented 4 years ago

I'm attempting to add an example, based on the deepspeech-rs example. However, it's unclear to me what needs to be done to make RNNoise available.

I've tried as followed:

  1. Download, build, and install https://github.com/xiph/rnnoise
  2. per:
    
    Libraries have been installed in:
    /usr/local/lib

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following:

  = note: /usr/bin/ld: /home/jandrews/devel/rust/rnnoise-c/target/debug/deps/librnnoise_c-1628727e08bfcf2f.rlib(rnnoise_c-1628727e08bfcf2f.3ko8bgui1uecfkbv.rcgu.o): in function `rnnoise_c::DenoiseState::new':
          /home/jandrews/devel/rust/rnnoise-c/src/lib.rs:12: undefined reference to `rnnoise_create(RNNModel*)'
          /usr/bin/ld: /home/jandrews/devel/rust/rnnoise-c/target/debug/deps/librnnoise_c-1628727e08bfcf2f.rlib(rnnoise_c-1628727e08bfcf2f.3ko8bgui1uecfkbv.rcgu.o): in function `<rnnoise_c::DenoiseState as core::ops::drop::Drop>::drop':
          /home/jandrews/devel/rust/rnnoise-c/src/lib.rs:35: undefined reference to `rnnoise_destroy(DenoiseState*)'
          collect2: error: ld returned 1 exit status
est31 commented 4 years ago

@jeremyandrews the bug is fixed now. Do you want to file a PR to complete the example?

est31 commented 4 years ago

Also btw, installing/building of rnnoise is not required. rnnoise-c is doing the compilation for you and uses rnnoise in a way you don't have to install it.

jeremyandrews commented 4 years ago

I now see a different error when I try to compile:

  = note: /usr/bin/ld: /home/jandrews/devel/rust/rnnoise-c/target/release/deps/librnnoise_c-9dab8923a36d520f.rlib(rnnoise_c-9dab8923a36d520f.rnnoise_c.7mz93gsc-cgu.0.rcgu.o): in function `rnnoise_c::DenoiseState::new':
          rnnoise_c.7mz93gsc-cgu.0:(.text._ZN9rnnoise_c12DenoiseState3new17h2251e03f729ce3e0E+0x4): undefined reference to `rnnoise_create(RNNModel*)'
          /usr/bin/ld: /home/jandrews/devel/rust/rnnoise-c/target/release/deps/librnnoise_c-9dab8923a36d520f.rlib(rnnoise_c-9dab8923a36d520f.rnnoise_c.7mz93gsc-cgu.0.rcgu.o): in function `<rnnoise_c::DenoiseState as core::ops::drop::Drop>::drop':
          rnnoise_c.7mz93gsc-cgu.0:(.text._ZN65_$LT$rnnoise_c..DenoiseState$u20$as$u20$core..ops..drop..Drop$GT$4drop17h42bbd76cbeb44f75E+0x5): undefined reference to `rnnoise_destroy(DenoiseState*)'
          collect2: error: ld returned 1 exit status

Am I misunderstanding how to declare a Denoise State?

jeremyandrews commented 4 years ago

Actually, not a new error, the same error. Do I need to do more than cargo clean for this change to take effect?

jeremyandrews commented 4 years ago

BTW: to generate the above error I'm running the following:

cargo build --examples
est31 commented 4 years ago

Umm yeah I hadn't published the crate yet, sorry. Could you git pull and try it now?

jeremyandrews commented 4 years ago

Thanks! That worked. I'll try and make time to complete the example soon.