Reducing/removing clipping in SoX when converting the sample rate

As suggested by the tool, try reducing the volume slightly, e.g. by preceding with -v 0.99 (or 0.98 etc.). Such small changes in volume are imperceptible.

Example:

sox -v 0.99 <source_wav> -b 16 <dest_wav> channels 1 rate 16000 trim <startTime> =<endTime>

If you still get clipping then the audio is likely severely clipped (i.e. disorted) to begin with (this is common with modern music; see Wikipedia: Loudness war) and so the warnings can be ignored—no additional distortion is being introduced.

As mentioned in the comments, the -G option can be given which will automatically make any adjustment to the volume needed to avoid clipping (at the expense of a little extra CPU time, i.e. it runs slightly slower with -G).

Leave a Comment