18

Given a audio.wav recording with silence at both start and end for at least 1second...

How to denoise with SOX ?

Hugolpz
  • 17,296
  • 26
  • 100
  • 187

1 Answers1

45

What is SOX

  • SoX - Sound eXchange, the Swiss Army knife of audio manipulation

Create noise file from input audio's initial 0.9s silence + room's noise

# sox in.ext out.ext trim {start: s.ms} {duration: s.ms}
sox audio.wav noise-audio.wav trim 0 0.900

Generate a noise profile in sox:

sox noise-audio.wav -n noiseprof noise.prof

Clean the noise from the audio

sox audio.wav audio-clean.wav noisered noise.prof 0.21

According to source :

Change 0.21 to adjust the level of sensitivity in the sampling rates (I found 0.2-0.3 often provides best result).

Sources

Hugolpz
  • 17,296
  • 26
  • 100
  • 187
  • I get: `sox FAIL noisered: multi-channel effect drained asymmetrically!` – funerr Apr 16 '23 at 06:13
  • 1
    @funerr you need to make sure both the input sound and the noise wav files are mono first. You can convert them with any of these 2 commands: `sox sample_en_with_background_noise.wav sample_en_with_background_noise_1ch.wav remix 1` or `ffmpeg -i stereo.wav -af "pan=mono|FC=FR" stereo_mono.wav` – est.tenorio May 24 '23 at 21:19