canonical audio format on mac osx 10.8
canonical audio format on mac osx 10.8
- Subject: canonical audio format on mac osx 10.8
- From: Joel Reymont <email@hidden>
- Date: Thu, 01 Nov 2012 17:34:29 +0000
I keep getting the 'fmt?' error from the following code on the Mac.
What am I doing wrong?
Thanks, Joel
P.S. I'm actually getting 4096 x 2 (channels) samples at a time over
the network but that's another story.
---
OSStatus OpenAudioFile(ExtAudioFileRef& file)
{
AudioStreamBasicDescription desc{};
desc.mSampleRate = 131072;
desc.mFormatID = kAudioFormatLinearPCM;
desc.mFormatFlags = kAudioFormatFlagIsFloat
| kAudioFormatFlagsNativeEndian
| kAudioFormatFlagIsPacked
| kAudioFormatFlagIsNonInterleaved;
desc.mBytesPerPacket = 4;
desc.mFramesPerPacket = 1;
desc.mBitsPerChannel = 32;
desc.mBytesPerFrame = 4;
desc.mChannelsPerFrame = 2;
AudioChannelLayout layout{};
layout.mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelBitmap;
layout.mChannelBitmap = kAudioChannelBit_Left | kAudioChannelBit_Right;
// layout.mNumberChannelDescriptions = 0;
//FillOutASBDForLPCM(desc, 131072, 2, 32, 32, true, false, true);
CFStringRef ref;
ref = CFStringCreateWithCString(kCFAllocatorDefault,
"/tmp/lanxi.caff",
kCFStringEncodingUTF8);
CFURLRef destinationURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
ref,
kCFURLPOSIXPathStyle,
false);
return ExtAudioFileCreateWithURL(destinationURL,
kAudioFileCAFType,
&desc,
&layout,
kAudioFileFlags_EraseFile,
&file);
//ExtAudioFileWrite(file, mNumberFrames, inBL);
}
--------------------------------------------------------------------------
for hire: mac osx device driver ninja. kernel, usb and coreaudio drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden