Convert and Normalize Audio with SoX

Use SoX — 'the Swiss Army knife of audio manipulation' — to transcode between formats, resample, and normalize gain in one pipeline.

LinuxaudiosoxnormalizeconvertLow risk
Run sox input.wav output.mp3 to convert formats, and sox input.wav output.wav gain -n -3 to normalize the peak level to -3 dB.

01Command

Command
$ sox input.wav -C 6.5 output.mp3
gain -n -3 output.mp3   # normalize peak to -3 dB (as second pass)

02What it does

sox reads input files, applies effects left to right, then writes the output; the format is inferred from the file extension, and -C sets the compression quality when encoding MP3/ogg. The gain effect with -n computes the gain needed to reach the target peak (-3 dB here) without clipping. Effects chain naturally, so things like sox in.wav out.mp3 gain -n -3 rate 44100 convert, resample, and normalize in one call.

03Risk

RiskLow risk
Requirementssox (sudo apt install sox libsox-fmt-all / sudo dnf install sox)
!Warning: Debian/Ubuntu's base sox package omits MP3 support — install libsox-fmt-all or conversions to MP3 will fail with 'no handler for file extension'.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • sox(1) — Linux man page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: Full sox man page: 'SoX - Sound eXchange, the Swiss Army knife of audio manipulation' covering format conversion, -C compression, and the gain effect with -n normalize option.

Last verified: 2026-09-17 · Category: Media