(Apologies for the cross posting with devforums)
I'm storing my audio data in memory as non-interleaved float, and I'm using ExtAudioFile to encode it to both AIFF and ALAC. The resulting files are both playable and contain the correct data when decoded, but the ALAC file is almost twice the size of the AIFF file. (AIFF - 43.5MB, ALAC - 73.9MB). When I convert the AIFF file to ALAC using iTunes the file is only about 24MB.
Looking at the Finder Info window for each file the ALAC file I created does not have an entry for 'Bits per sample'. The AIFF file and the iTunes generated ALAC both say 'Bits per sample: 16'.
From this, I'm guessing that the ALAC file I'm generating is using a higher bitrate than 16.
The code I'm using is:
_outputFormat.mSampleRate = 44100;
_outputFormat.mFormatID = kAudioFormatAppleLossless;
_outputFormat.mChannelsPerFrame = 2;
AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, sizeof(_outputFormat), &_outputFormat);
ExtAudioFileCreateWithURL(urlRef, kAudioFileM4AType, &_outputFormat, ...);
I've tried setting the mBitsPerChannel for my output ASBD after I call AudioFormatGetProperty, but it doesn't change anything.