sox

Universal command-line audio processor

TLDR

Convert audio format
$ sox [input.wav] [output.mp3]
Concatenate files
$ sox [file1.wav] [file2.wav] [output.wav]
Change sample rate
$ sox [input.wav] -r [44100] [output.wav]
Mix to mono
$ sox [input.wav] [output.wav] channels 1
Add reverb
$ sox [input.wav] [output.wav] reverb
Trim audio
$ sox [input.wav] [output.wav] trim [0] [10]
Normalize volume
$ sox [input.wav] [output.wav] norm
Record audio
$ sox -d [output.wav]

SYNOPSIS

sox [options] infiles outfile [effects...]

DESCRIPTION

sox (Sound eXchange) is a command-line audio processing tool. It converts between formats, applies effects, and can record and play audio.The tool supports many audio formats and provides extensive processing capabilities including filtering, mixing, and format conversion.

PARAMETERS

-r rate

Sample rate.
-c channels
Number of channels.
-b bits
Sample size in bits.
-e encoding
Sample encoding.
-t type
File type.
-v factor
Volume adjustment.
-d
Default audio device.
--combine type
Combine method (concatenate, merge, mix).

EFFECTS

trim: Cut portionfade: Fade in/outreverb: Add reverbnorm: Normalizespeed: Change speedpitch: Shift pitchequalizer: EQ adjustmentcompand: Compression

INSTALL

sudo apt install sox
sudo dnf install sox
sudo pacman -S sox
sudo apk add sox
sudo zypper install sox
brew install sox
nix profile install nixpkgs#sox

CAVEATS

Some formats need external libraries. Complex effects chains can be slow. Quality depends on parameters. Some effects modify duration.

HISTORY

SoX was started by Lance Norskog in 1991 and has been developed by many contributors. It became the Swiss Army knife of audio processing on Unix systems.

SEE ALSO

ffmpeg(1), lame(1), flac(1), aplay(1)