xiph / rnnoise

Recurrent neural network for audio noise reduction
BSD 3-Clause "New" or "Revised" License
4.16k stars 906 forks source link

Adjustable amount of reduction #7

Open lucianodato opened 7 years ago

lucianodato commented 7 years ago

Hello Jean-Marc! This is probably something that you already were planing but completely remove noise during low SNR portions of the sound doesn't always sounds good. Easily fixable in my plugin (https://github.com/lucianodato/speech-denoiser) but something you should consider for the library. By the way I'm having troubles making it work in my plugin, does the library support 32 bit floats or do I have to cast them down to 16 bits???

jhoelzl commented 7 years ago

Such option would be great!

lucianodato commented 7 years ago

I can fix that problem introducing an adjustable reduction but in my plugin not in the library itself. I can't get it to work though. I believe it something that might be related to the data I'm feeding it with but I'm not sure.

JanX2 commented 7 years ago

@lucianodato Did you try the sample code? You can also give this a spin: https://gist.github.com/JanX2/b4d283b0ab83986b16315cf2817ee50d

RNNoise works fine for removing noise from my sample file with the example linked above. You currently need to supply RAW 16-bit (machine endian) mono PCM files sampled at 48 kHz. This could be easily changed to float.

lucianodato commented 7 years ago

@JanX2 I'm mostly interesting in realtime usage of the library or at least building on top of the library for that use case. The example code works offline and also yours (by the way are you an audacity dev?). I'm developing an lv2 plugin based on this library because is much better than what I previously developed myself for adaptive speech noise reduction.

JanX2 commented 7 years ago

@lucianodato In such cases, I use a ring buffer to decouple the sample counts produced and consumed.

I use Audacity a lot for its ability to read and write files containing raw samples and for its text label support. Not affiliated with the project otherwise. ;)

liuanping commented 7 years ago

Hi! I have read your paper, and i believe it is a good idea. So i want use my noise to train in your way. But i met some strange problem. Can you please provide the python version、 keras version to me. And i think the dump_rnn.py is for model reading?

lucianodato commented 7 years ago

@liuanping Hi maybe that comment should be in another issue instead of this one. @JanX2 I had to implement better buffering, yes. I'm using a delay block now and that's lazy I know. Anyways I understand that this library is for webrtc and codecs but adding support for 32 bits floats and any arbitrary block size would be great (maybe I should file another issue for that).

JanX2 commented 7 years ago

This library isn’t for WebRTC AFAIK. @jmvalin can probably tell us more about what he want’s to use it for, but the blog post is probably the best source of information about RNNoise for now: https://people.xiph.org/~jm/demo/rnnoise/

jmvalin commented 7 years ago

I wasn't really considering a floor, but it's something that would be easy. In the demo files, some people made me realized that the denoised files sometimes sound a little too "dry", so I just checked in a change to make the gain decay less abrupt. Let me know if that reduces the need for a floor on the attenuation.

lucianodato commented 6 years ago

Well there is a fork of rnnoise that already has this https://github.com/GregorR/rnnoise-nu. I'm using that now.

TerenzeY commented 5 years ago

@jmvalin the denoised files for my use case are very choppy / dry. Any suggestions on where to adjust?

@lucianodato does GregorR's fork fixes this?