The caff files that are generated by afconvert as an intermediate step are 32-bit floating point audio files, and the sample-rate conversion can be done at a very high quality and it reduces or eliminates the need to dither the output when converting word sizes. This is then used as a direct input to afconvert once more to create an AAC file directly. afconvert is a standard command-line tool on OS X 10.6+ and will accept any file format that Core Audio understands (eg WAVE, AIFF, ALAC but not FLAC)
Internally, the tool checks the sample-rate. If it's using a sample rate greater than 44.1kHz, it runs this command:
Code: Select all
afconvert <input file> -d LEF32@44100 -f caff --soundcheck-generate --src-complexity bats -r 127 <output file.caf>
Code: Select all
afconvert <input file> <output file.caf> -d 0 -f caff --soundcheck-generate
Code: Select all
afconvert <input file.caf> -d aac -f m4af -u pgcm 2 --soundcheck-read -b 256000 -q 127 -s 2 <output file.m4a>