Thanks for the suggestion. I was able to write to a file and use afplay to play it back!!!!
The following parameters are passed to the ExtAudioFileCreateNew for the stream description which works.
fileformat.mSampleRate = 44100.0;
fileformat.mFormatID = kAudioFormatMPEG4AAC;
fileformat.mFormatFlags = 0;
fileformat.mBytesPerPacket = 0;
fileformat.mFramesPerPacket = 1024;
fileformat.mBytesPerFrame = 0;
fileformat.mChannelsPerFrame = 2;
fileformat.mBitsPerChannel = 0;
fileformat.mReserved = 0;
If I change the format to linear pcm the create call fails complaining about the format. I don't understand why. I copied these settings from an example, so how they relate to each other is unclear to me. Do different encodings require different settings? What's the strategy for determining these values? It seems to depend on hardware and data rates. Are there formulas or libraries to calculate these settings for different encodings?
Also, if I try to change the file type from caff to m4af or mp4f, the file gets created but the number of bytes are set to zero. Neither QuickTime or iTunes can play the contents. I'm doing something wrong considering the file should be encoded as a kAudioFormatMPEG4AAC.
Thanks again,
Ashley