I have a directory with about 50 wav files that I need to convert to caf, because AudioServicesCreateSystemSoundID() returns an error for some of them (but not all).
Her
Similar approach for bash: for i in *.wav; do afconvert -f caff -d LEI16@44100 -c 1 $i ${i%.wav}.caf; done
for i in *.wav; do afconvert -f caff -d LEI16@44100 -c 1 $i ${i%.wav}.caf; done