Le Blog Utux

HTTP 200 GET /

My experiments with rnnoise (an alternative to NVIDIA Broadcast)

Rédigé par uTux Aucun commentaire

I've been using NVIDIA Broadcast for years, a magic tool that helps me to record my voice by removing static / white / ambient noise and even nullifying the reverberation in my room. This software requires of course Microsoft Windows AND an NVIDIA card.

The result was quite impressive but I needed an alternative since I don't use Windows any longer neither an NVIDIA card. That's when I found out rnnoise which is a free software compatible with Linux.

Note: I will explaine how use rnnoise to convert a raw or wav file. I don't know how to use it to filter out audio on a live stream. I assume it's possible since rnnoise is a library that can be used as a plugin for obs-studio or pipewire but I just didn't try that part.

Yep, the README is pretty scary and the whole project feels like a collection of tools that are not designed for end users. Fortunately, they provide a "demo" cli tool that is able to clean an audio file, and it works fine.

Building rnnoise

On Debian 12, I had to install those requirements:

sudo apt install dh-autoreconf autoconf libtool make git

Then fetch the source code:

git clone http://github.com/xiph/rnnoise.git

Now read the instructions from the README in order to build rnnoise:

cd rnnoise
./autogen.sh
./configure
make

The right input format

We can't just feed rnnoise with any wav or mp3 file. According to the documentation:

While it is meant to be used as a library, a simple command-line tool is
provided as an example. It operates on RAW 16-bit (machine endian) mono
PCM files sampled at 48 kHz.

We need to produce a RAW audio file with the right specs. So open your wav audio file in Audacity, and perform those steps:

  • If your file is stero, CTRL+A to select everything, then click Tracks > Mix > Mix Stereo Down to Mono
  • On the bottom, select Project Rate (Hz) to 48000.

Now save your file as RAW audio:

  • Click File > Export > Export Audio
  • On the bottom right click on the menu and select "Other uncompress files". On Header select RAW (header-less) and on Encoding select Signed 16-bit PCM. That's it. Export your file.

Your file is now ready to be "de noised"!

Running rnnoise

You just have to run rnnoise_demo into the examples directory:

cd examples
./rnnoise_demo /path/to/examples43434.raw /path/to/examples43434_rnnnoised.raw

And voilà!

The result is another RAW file that you can open in audacity using File > Import > Raw Data.

Final thoughts

I record my voice in French and the result is really great. It's as good as NVIDIA broadcast, maybe even better because the later is designed to act during the recording process (like as a filter on your microphone) while rnnoise can work with sounds that have already been recorded. NVIDIA broadcast seems designed for streamers while rnnoise is more suited for video editing.

Écrire un commentaire

Quelle est le sixième caractère du mot tf4mxj8p ?