xiph / rnnoise

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

Noise at the start of every processed audio #200

Open Domhnall-Liopa opened 2 years ago

Domhnall-Liopa commented 2 years ago

Hi, thanks for the great work.

When I pass any audio file to the tool, it always seems to miss a short bit of noise at the start of the audio. The noise is removed from the rest of the audio.

I use the following commands with ffmpeg version 4.4.1:

# 1. convert audio file to correct sample rate and codec
ffmpeg -y -i audio.wav -ac 1 -ar 48000 -f s16le -acodec pcm_s16le audio.pcm

# 2. run rnnoise with previous output
/opt/rnnoise/examples/rnnoise_demo audio.pcm audio_noise_removed.pcm

# 3. pcm to wav
ffmpeg -y -f s16le -ar 48000 -ac 1 -i audio_noise_removed.pcm audio_noise_removed.wav

# 4. convert back to previous sample rate
ffmpeg -y -i audio_noise_removed.wav -ac 1 -vn -acodec pcm_s16le -ar 16000 audio_denoised.wav

I've attached an example: Original audio: https://drive.google.com/file/d/1pCnaLsBgc-wYDkI_ucMPDizKA7dp7KXH/view?usp=sharing Output audio: https://drive.google.com/file/d/1m2cu-8OgAMDyQRcgDqskRilegxCNL5Ju/view?usp=sharing

Have you any ideas why this might be?

egorsmkv commented 7 months ago

Hi, have you solved this?

andrewfowlie commented 1 month ago

Not a true solution, but something like this can silence the first second (replace (t,0,1) by the time interval you wish to silence in seconds)

ffmpeg -i noise.mkv -af "volume=enable='between(t,0,1)':volume=0,arnndn=${RNN}" denoise.mkv

RNN is a variable containing path to your chosen noise model.

richardpl commented 1 month ago

arnndn filter implementation does not have this bug, so using volume filter is considered useless.