rnnoise_demo
requires raw audio, not wav. I have created a python-script for rnnoise&sox filtering for a preprocessing toolchain (not the nicest programming, but does its job):
from pathlib import Path
import subprocess
src = "/path/to/your/wav/files/"
rnn = "/path/to/rnnoise_demo"
paths = Path(src).glob("*.wav")
i = 0
for filepath in paths:
i += 1
print(str(filepath))
filename = str(filepath).split("/")[-1]
#print(filename)
subprocess.run(["sox", filepath, "48k.wav", "remix", "-", "rate", "48000"]) #stereo to mono and upsample to 48000Hz
subprocess.run(["sox", "48k.wav", "-c", "1", "-r", "48000", "-b", "16", "-e", "signed-integer", "-t", "raw", "temp.raw"]) # convert wav to raw
subprocess.run([rnn, "temp.raw", "rnn.raw"]) # apply rnnoise
subprocess.run(["sox", "-r", "48k", "-b", "16", "-e", "signed-integer", "rnn.raw", "-t", "wav", "rnn.wav"]) # convert raw back to wav
subprocess.run(["rm", "-f", str(filepath)]) # overwrite file at destination
subprocess.run(["sox", "rnn.wav", str(filepath), "remix", "-", "highpass", "100", "lowpass", "7000", "rate", "22050"]) # apply high/low pass filter and change sr to 22050Hz
#if i == 10: # for testing stop after ten files
# break
print("total: ", i)