Re: canonical audio format on mac osx 10.8
Re: canonical audio format on mac osx 10.8
- Subject: Re: canonical audio format on mac osx 10.8
- From: Joel Reymont <email@hidden>
- Date: Thu, 01 Nov 2012 20:57:24 +0000
Chris,
Thanks for pointing this out but the problem persists :-(.
On Thu, Nov 1, 2012 at 6:08 PM, Chris Adamson <email@hidden> wrote:
> If mBitsPerChannel == 32, and mChannelsPerFrame = 2, then I think mBytesPerFrame should be 8. Same for mBytesPerPacket.
>
> -Chris
>
> On Nov 1, 2012, at 1:34 PM, Joel Reymont <email@hidden> wrote:
>
>> 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
>
--
--------------------------------------------------------------------------
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