Troubleshooting
Most sox problems fall into a small set of patterns. Each one has a quick diagnostic.
Silent output
The file exists, soxi shows sensible numbers, and you hear nothing.
Likely causes, in order:
- Audio device: another app has the output, or
playis pointed at the wrong sink. Tryplayon a known-good file first (play -n synth 1 sine 440). If that is silent, it’s not a sox problem. -vin the wrong section:sox -v 0 input.wav out.wavscales the input to zero, producing a silent file — no error. Check that-vbelongs where you put it (see chapter 2).- System volume muted at the OS level — check that independently.
Clipping
Clipping sounds like harsh distortion on loud passages — a kind of fuzzy crunch that tracks peaks rather than being continuous. Common causes:
gain Nafternorm:normlifts the peak to 0 dBFS, thengainpushes above it. Reorder, ornorm -Ninstead.- Mixing without headroom:
-msums inputs, so two full-scale signals clip immediately. Either-v 0.5each input ornorm -3the result. - Upsampling a signal that was already at 0 dBFS — the interpolator’s ringing can exceed the original peak.
Detect clipping with stats:
sox output.wav -n stats
Watch the Pk lev dB line and the Flat factor / Num samples
report for saturated counts. A non-zero Flat factor on output that
shouldn’t have any flat runs is a strong signal.
Format mismatch on concat or mix
Sox hard-fails when inputs to concatenation or -m mixing differ in
sample rate or channel count:
sox FAIL sox: Input files must have the same sample-rate
Fix by pre-processing the outlier:
sox other.wav -r 44100 other-44k.wav # match the rate
sox mono.wav -c 2 mono-stereo.wav # match channels
sox main.wav other-44k.wav combined.wav # now concat works
Or do it in a single pipeline with -p:
sox other.wav -p rate 44100 channels 2 | sox main.wav - combined.wav
play fails on headless systems
play needs a working audio device. On servers, CI, and containers,
it typically can’t find one and errors out. Diagnose a chain without
actually playing:
# Write to /dev/null-style null output and read stats
sox input.wav -n stats
# Or render to a temp file and inspect with soxi
sox input.wav out.wav <effects>
soxi out.wav
-n as the output lets effects run through to stat/stats
without needing a device.
Typos that silently mean something else
Effect names in sox aren’t validated against a “did you mean” list;
a misspelling is often a valid effect that does something completely
different. bass and bas both parse; one of them isn’t the
shelving filter. Similarly, format flags put in the wrong section
apply to the wrong file without a warning.
The defense: eyeball the command before running, and use -V3 to
see what sox actually thinks it’s doing.
Use -V for diagnostics
Sox takes a verbosity level from -V1 (errors only) up through
-V4 (everything it knows). -V3 is the usual sweet spot — it
prints the effect chain as sox understands it, including which
effects actually ran and with what arguments:
sox -V3 input.wav out.wav highpass 100 norm -3
If an effect isn’t doing what you expected, -V3 usually tells you
why in the first few lines.
Reading sox error messages
Most sox errors are in the form sox FAIL <subsystem>: <message>.
A few common ones:
sox FAIL formats: no handler for file extension ...— you asked sox to read or write a format without a-tflag, and the extension didn’t disambiguate. Add-t wav(or whatever).sox FAIL sox: Input files must have the same sample-rate— see the format-mismatch section above.sox FAIL rate: Input sample-rate ... is unchanged— you askedrateto resample to the rate it’s already at. Remove the effect.sox WARN ...: clipped N samples; ...— output clipped; see the clipping section above.
When in doubt, re-run with -V3 — the warning is usually right next
to the line that caused it.