Program For Converting a Ton of Samples

Great, the -G gets rid of most of the clipping. There are still a few files giving me a clipping error, but I am not sure it is worth tracking down which ones and trying to fix them (edit: adding the dither -s option eliminated the remaining clipping errors). I think @alspacka had the same problem.

So for anyone interested in doing the same thing as I did with sox in macOS the final terminal command I used was:

for f in **/**; do if [ -d "$f" ]; then mkdir -p "CONV/$f"; fi; if [[ $f == *.wav ]]; then sox -G "$f" -b 16 "CONV/$f" rate -v 48k dither -s; fi; done

it converts the audio to 16 bit (-b 16) and 48khz using the very high quality algorithm (rate -v 48k) and avoids clipping (-G). The dither -s (dither with shibata noise shaping) was recomended over the default for 16bit and it also got rid of any remaining clipping warnings thet -G did not eliminate.

The command stores the converted files in a folder called CONV and preserves the folder structure. If you want to do a different bit depth just change the number after the -b, and for a different sample rate change the 48k to whatever you want.

Whew, now I can get back to making music!

5 Likes