Trim, join and mix
sox <in> <out> trim <start>
<len>
Cut a piece by start and length
sox <in> <out> trim <start>
=<end>
Cut up to an absolute position
sox <in> <out> trim 0 -5
Drop the last 5 seconds
sox <a> <b> <out>
Concatenate files
Inputs need the same rate and channels, or sox converts to the
first file's.
sox -m <a> <b> <out>
Mix files on top of each other
sox -M <l.wav> <r.wav> <out>
Merge mono files into channels
sox <in> <out> remix 1
Keep only the left channel
sox <in> <out> remix 1,2
Mix both channels to mono
sox <in> <out> pad 2 0
Add 2 s silence at the start
sox <in> <out> repeat 2
Play the audio 3 times
sox <in> <out> reverse
Reverse the audio
sox <a> <b> <out> splice -q
<pos>
Cross-fade join at position
sox <in> <out> delay 1 1
Delay each channel by 1 s
sox <in> <out> trim 0 10 : newfile :
restart
Split into pieces of 10 s
sox <in> <out> channels 2
Convert to stereo
Volume and fades
sox <in> <out> norm
Normalize peak to 0 dBFS
sox <in> <out> norm -3
Normalize peak to -3 dBFS
sox <in> <out> gain <dB>
Change level by dB
sox <in> <out> vol <factor>
Multiply amplitude by a factor
sox -v <factor> <in> <out>
Scale input before combining
sox <in> <out> gain -n -3
Same as norm -3
sox <in> <out> gain -l <dB>
Boost with a simple limiter
sox <in> <out> fade <in-s> 0
<out-s>
Fade in and out
Fade-out needs the stop position; 0 means the end of the file.
The input length must be known.
sox <in> <out> fade t 3
Linear 3 s fade-in only
sox <in> <out> compand 0.3,1 6:-70,-60,-20 -5
-90 0.2
Compress dynamic range
sox --norm <a> <b> <out>
Normalize whatever the mix produces
Rate, speed and pitch
sox <in> <out> rate <hz>
Resample to a rate
sox <in> <out> rate -v 48k
Resample, very high quality
sox <in> <out> speed <factor>
Change speed and pitch together
sox <in> <out> tempo <factor>
Change speed, keep the pitch
sox <in> <out> pitch <cents>
Shift pitch, keep the speed
100 cents are one semitone.
sox <in> <out> speed 1.0595
Raise one semitone with speed
sox <in> <out> tempo -s <factor>
Tempo tuned for speech
Filters and clean-up
sox <in> <out> highpass <hz>
Cut low rumble
sox <in> <out> lowpass <hz>
Cut high hiss
sox <in> <out> bass <dB>
Boost or cut the lows
sox <in> <out> treble <dB>
Boost or cut the highs
sox <in> <out> equalizer <hz>
<width>q <dB>
Adjust one frequency band
sox <in> <out> silence 1 0.1 1% -1 0.5 1%
Trim silence at start and end
sox <in> <out> silence -l 1 0.1 1% -1 1.0
1%
Cap long silences, keep gaps
sox <noise.wav> -n noiseprof <prof>
Learn a noise profile
sox <in> <out> noisered <prof> 0.21
Reduce noise with the profile
sox <in> <out> loudness
Equal-loudness compensation
Analyse and generate
sox <in> -n spectrogram
Write spectrogram.png
sox <in> -n spectrogram -o <out.png>
Spectrogram to a chosen PNG
sox <in> -n spectrogram -x 1600 -Y 400
Set image width and height
sox <in> -n spectrogram -l -r
Light background, raw, no axes
sox <in> -n stat -v
Print the volume adjustment for norm
sox -n <out> synth 3 sine 440
Generate a 3 s sine tone
sox -n <out> synth 5 whitenoise
Generate noise
sox -n <out> trim 0 5
Generate 5 s of silence