• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
canonical audio format on mac osx 10.8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: canonical audio format on mac osx 10.8
      • From: Chris Adamson <email@hidden>
  • Prev by Date: How to create an array of float from an audio file?
  • Next by Date: Re: canonical audio format on mac osx 10.8
  • Previous by thread: How to create an array of float from an audio file?
  • Next by thread: Re: canonical audio format on mac osx 10.8
  • Index(es):
    • Date
    • Thread