I'm developing an update for my radio app and I would like to let the user record audio. I'm trying to use ExtAudioFile with no luck. The problem is happening when setting the kExtAudioFileProperty_ClientDataFormat. Here's my code:
AudioStreamBasicDescription mDesc;
mDesc.mChannelsPerFrame = 1;
mDesc.mSampleRate = 44100.0;
mDesc.mFormatID = kAudioFormatLinearPCM;
mDesc.mFormatFlags = kLinearPCMFormatFlagIsBigEndian | kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;
mDesc.mBitsPerChannel = 16;
mDesc.mBytesPerFrame = mDesc.mChannelsPerFrame * mDesc.mBitsPerChannel / 8;
mDesc.mFramesPerPacket = 1;
mDesc.mBytesPerPacket = mDesc.mBytesPerFrame * mDesc.mFramesPerPacket;
UInt32 propSize = sizeof(mDesc);
createFile = ExtAudioFileSetProperty(ref, kExtAudioFileProperty_ClientDataFormat, propSize, &mDesc);