sox
Convert, edit, and play audio files
TLDR
Merge two audio files into one
Trim an audio file to the specified times
Normalize an audio file (adjust volume to the maximum peak level, without clipping)
Reverse and save an audio file
Print statistical data of an audio file
Increase the volume of an audio file by 2x
SYNOPSIS
sox [global-options] [input-file] [output-file] [effects]
PARAMETERS
input-file
The input audio file. If omitted, SoX reads from standard input.
output-file
The output audio file. If omitted, SoX writes to standard output.
[effects]
One or more audio effects to apply. Each effect has its own parameters.
-d, --default-device
Use the default audio device for input or output.
-h, --help
Display help information.
-v, --volume factor
Adjust the volume by the given factor (e.g., 0.5 for half volume).
--version
Display SoX version information.
--combine sequence
Method to combine multiple input files. Possible values: merge, concatenate, mix.
--norm
Normalise the audio to a maximum volume. Prevents Clipping.
DESCRIPTION
SoX, the Sound eXchange, is a powerful command-line utility for converting, editing, and playing audio files. It supports a wide range of audio formats and provides extensive manipulation capabilities, including sample rate conversion, volume adjustment, audio effects (echo, reverb, chorus, etc.), and format conversion. SoX can be used for batch processing of audio files, real-time audio recording and playback, and complex audio processing tasks. It's invaluable for audio engineers, musicians, and anyone needing versatile audio handling in a Linux environment. SoX utilizes libsndfile library for input and output of most file formats. Many effects are provided using a simple set of parameters.
SoX is also widely used as a back-end for many GUI tools and audio processing software.
CAVEATS
Some audio formats might require additional libraries or codecs to be installed for SoX to support them. The order of effects can significantly affect the output audio. When using stdin or stdout as input/output, the format must often be specified using global options. When writing to stdout, the file format has to be specified as well, and usually needs to be compatible with the stdout (for example using `raw` audio format when piping to another program).
COMMON EFFECTS
Some commonly used effects include: `reverse`, `fade`, `trim`, `echo`, `reverb`, `chorus`, `flanger`, `phaser`, `speed`, `tempo`, `pitch`.
FORMAT SUPPORT
SoX supports numerous audio formats including WAV, MP3, FLAC, AIFF, and many more. You can use the `sox --help` command to list available formats. Using an external library will expand this list.
HISTORY
SoX was initially created in the mid-1990s and has been continuously developed and maintained since. It has gained popularity as a reliable and versatile tool for audio processing, widely used in both command-line scripting and graphical user interface applications.