xiph / rnnoise

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

file generated unreadable #214

Open victorrosi opened 1 year ago

victorrosi commented 1 year ago

Hello,

First of all thank you for this great tool that I wish to add to my pipeline for audio dataset preprocessing.

I tried rnnoise few weeks ago on a 45 minutes long audio file (16bit, 48 kHz) and it worked really well in the command line.

However I've bee trying to use it on smaller samples (4-5 seconds) but the file generated is unreadable and while it seems to be identified as a wave audio file, it's impossible to see it's information. I tried it both on google colab and a personal conda environment.

I don't seem to have any error message on installation after typing this:

""" % git clone https://github.com/xiph/rnnoise.git % cd rnnoise % ./autogen.sh % ./configure % make """

installation seems to be ok:

Screenshot 2023-03-31 at 15 27 04

Thank you for your help :)))

grazder commented 1 year ago

Same problem

ericlaycock commented 1 year ago

Okay, I figured out why this is happening. It's outputting .pcm files into your output directory, even though they may be named as .wav files, they actually are 16bit .pcm files.

Running this command on your "disguised" .pcm folder (the folder holding your 'corrupted' .wav files) should work (you may need to pip install sox or sudo apt-get sox if you don't have it):

rnnoise_output/*; do sox -t raw -b 16 -e signed -c 1 -r 48000 "$file" rnnoise_output_wav/"$(basename "$file" .wav).wav"; done

where rnnoise_output/ is the directory holding your 'corrupted' .wav files, and 'rnnoise_output_wav/' is the directory holding your actual correct .wav files.

Pawandeep-prog commented 6 months ago

actually input is expected to be PCM and output is also PCM

you can use ffmpeg to convert your audio file into pcm file and output file from pcm into mp3/ wav file

input conversion : ffmpeg -i ./sample-ac 1 -ar 48000 -f s16le -acodec pcm_s16le pcm-sample.pcm output conversion: ffmpeg -f s16le -ar 44100 -i ./pcm-sample-denoised.pcm output.mp3