-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
obs-filters: Add RNNoise to noise suppression filter #3263
Conversation
This thing is legit amazing. Also it does not use that much more CPU usage at all. |
A few demos: No noise suppression: https://streamable.com/g3i6sf |
I feel like this UI behavior is a bit strange.: https://streamable.com/cjs73p Maybe a dropdown to choose noise suppression algorithm would be better? |
I can add the dropdown. |
If a dropdown is added, you can move the text inside the current tooltip to be where the settings would otherwise be for RNNoise. Are there any worthwhile settings for RNNoise? I saw another person had an implementation for RNNoise here (demo) with several options but I don't know if they are actually useful to expose in practice. |
#define RNNOISE_SAMPLE_RATE 48000 | ||
#define RNNOISE_FRAME_SIZE 480 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be configurable? Does it make sense to have this sample rate fixed to 48 kHz when I want to output a different sample rate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these just match OBS sample rate settings? Adding settings is a double-edged sword for usability if we can select reasonable defaults or set things automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned near those constants, these can’t be changed. The sample rate is the one used by the samples used to train the standard model of RNNoise, and the frame size is fixed in the library. Feeding non-resampled 44100Hz audio in the model will yield bad results.
This commit adds support to using Xiph and Mozilla RNNoise library for noise reduction. RNNoise is a small library using an AI approach to noise reduction using a pre-trained model like RTX Voice. But unlike RTX Voice, it is very tiny, use CPU instead of GPU and only use little resources. Obviously it is not as efficient but will effectively remove background noise. It uses more CPU than the existing libspeex-based noise reduction but it also sounds sounds way better. RNNoise support is added to the noise reduction effect. It can be enabled with a checkbox in the effect configuration. RNNoise has no settings.
I was inspired by the layout of the noise reduction settings in Mumble, which use the two same libraries. |
This filter seems to be using an old fork of RNNoise. The parameters being used are not available in the current official library. Actually there are no settings at all, except for a way to use a custom model. I can add a way to reduce noise reduction by mixing the RNNoise output with its input if you wish. |
I'm a fan of fewer settings if they aren't needed. I was just wondering what was going on there. If we don't need settings, then there shouldn't be settings. |
A "dry mix" option could be useful in lieu of the ability to set the denoising strength. |
After testing this filter with some IRL streams, I think that an option to blend part of the original audio would be incredibly useful. RNNoise is incredibly decisive I've found. |
I have created a patch that unmasks the denoiser strengh slider when RNNoise is selected and uses its value as the gain with which the input of RNNoise is mixed into its output. At 0dB the result is only input audio, at -60dB there is virtually only RNNoise output. https://github.com/remjey/obs-studio/tree/rnnoise-drymix Here is a demo with a sample from the RNNoise demo page. I’ll create a pull request if you think it’s good. |
That looks pretty cool! Definitely worth a PR I think. My only thought on both this slider and the Speex slider is that it's probably not obvious to lay users that the higher the slider is, the less powerful the noise suppression is, especially with a label like "Suppression Level". My UX gut tells me that the dB spinners should be hidden and the slider effectively reversed such that 100% to the right is -60dB ("full") and 0% to the left is 0dB ("None"), i.e. "more slider = stronger noise suppression". I could be wrong though, curious to hear others' thoughts. |
Done: #3299 I’d say the slider makes sense in this orientation for me but I’m used to sound software. I think maybe to a regular user that design seems strange and the dB unit pretty opaque. On the other hand, this slider is coherent with the ones that can be found in the compressor, noise gate, expander and gain effects, which are more complex. I’d just add that from a user’s point of view, the noise reduction filter is a very easy yet very effective way to improve one’s stream’s sound quality. It is important that this filter is easy to understand and use. In my opinion the question is about whether it’s better to have a coherent interface for all effects, or invite the novice user to use the effects that bring the most improvement to the stream for the least amount of work by making their interface more intuitive. |
Description
This commit adds support to using Xiph and Mozilla RNNoise library for
noise reduction.
RNNoise is a small library using an AI approach to noise reduction
using a pre-trained model like RTX Voice. But unlike RTX Voice, it is
very tiny, use CPU instead of GPU and only use little resources.
Obviously it is not as efficient but will effectively remove background
noise. It uses more CPU than the existing libspeex-based noise
reduction but it also sounds sounds way better.
RNNoise support is added to the noise reduction effect. It can be
enabled with a checkbox in the effect configuration. RNNoise has no
settings.
Motivation and Context
RTX Voice isn’t available to everybody and libspeex noise reduction introduces
sound artifacts that are sometimes annoying. RNNoise works better than libspeex
while requiring no special hardware and uses only a little more CPU.
RNNoise support will only compile if the library is available on the system.
How Has This Been Tested?
This change is completely incremental. I tested it myself on my main computer
running Linux, Devuan Beowulf (based on Debian Buster). It doesn’t affect any
other area of code, however I had to add some cmake scripts to detect RNNoise.
Types of changes
Checklist: