recursiveley convert 32 bit floating to 32 bit files

Hi,

I’m trying to convert all the takes I did for a band with Ardour from 32bit floating point to regular 32 bit. I know I can do it with sox, but since it’s huge amount of files, is there a command line string to convert all of the files in a directory at once?

Thanks
Alessio

Thanks a lot I’ll try as soon as possible!

My universal one-liner (very well tested):

mkdir OutputDir && find . -maxdepth 1 -name '*.wav' -type f -print0 | xargs -0 -t -r -I {} sox {} OutputDir/{} rate -v -I 48000

Just replace “rate -v -I 48000” with your options, the results will be put in OutputDir. I adapted it from a post in pwnetics.wordpress.com (individual URL awkwardly long).

You should be able to do it with a simple shell “for” loop. Something like:

for f in *.wav ; do sox $f sox-options ${f/.wav/-fix.wav} ; done

where “sox-options” is replaced with the correct sox switches to define your output file format.

The intention is to convert each filename.wav to filename-fix.wav. Obviously you can choose your own naming scheme.
Warning: untested code! It might be a good idea to copy a couple of files to a temp directory and experiment there until you’ve got it right.

Almost anyone else will have better shell skills than mine and be able to pick holes in that or suggest a better way…