• 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
Re: How to capture audio generated by a render callback, iOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to capture audio generated by a render callback, iOS


  • Subject: Re: How to capture audio generated by a render callback, iOS
  • From: Tim Kemp <email@hidden>
  • Date: Thu, 06 Dec 2012 11:12:51 -0500

What are the flags in kAudioUnitFlagsCanonical?

On simulator and iOS, they they are Signed, Native, Packed.

Did you make sure the flags in your file's ASBD are
kAudioUnitFlagsCanonical also?

They are both now set to canonical. (There are two kinds of canonical: AudioFormatFlagsAudioUnitCanonical and AudioFormatFlagsCanonical; I'm using the latter (AudioFormatFlagsCanonical). The former crashes the call to create the file if set in the file ASBD and makes no difference to audio output if set in RemoteIO.)

From what I've seen of your code thus far, I think  you want
kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked.

That's the canonical format; that's what's now set. Just to be sure I set that explicitly and sound is still wrong. Here's the ASBDs again for reference:

// Set desired audio output format
        memset(&_outputASBD, 0, sizeof(_outputASBD));
        _outputASBD.mSampleRate        = 44100.0;
        _outputASBD.mFormatID          = kAudioFormatLinearPCM;
        _outputASBD.mFormatFlags       = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
        _outputASBD.mBytesPerPacket    = 2 * 2; // 2 channels, 2 bytes per
        _outputASBD.mBytesPerFrame     = 2 * 2; // 2 channels, 2 bytes per
        _outputASBD.mFramesPerPacket   = 1;
        _outputASBD.mChannelsPerFrame  = 2;
        _outputASBD.mBitsPerChannel    = 16;

        

        // Set recording format
        memset(&_fileASBD, 0, sizeof(_fileASBD));
        _fileASBD.mSampleRate          = 44100.00;
        _fileASBD.mFormatID            = kAudioFormatLinearPCM;
        _fileASBD.mFormatFlags         = kAudioFormatFlagsCanonical;
        _fileASBD.mBytesPerPacket      = 2 * 2;
        _fileASBD.mBytesPerFrame       = 2 * 2;
        _fileASBD.mFramesPerPacket     = 1;
        _fileASBD.mChannelsPerFrame    = 2;
        _fileASBD.mBitsPerChannel      = 16;

Thanks

On 6 Dec 2012, at 11:00, Joel Reymont wrote:

On Thu, Dec 6, 2012 at 3:50 PM, Tim Kemp <email@hidden> wrote:

I did so: changed my RemoteIO ASBD to use kAudioUnitFlagsCanonical.

What are the flags in kAudioUnitFlagsCanonical?

Did you make sure the flags in your file's ASBD are
kAudioUnitFlagsCanonical also?

From what I've seen of your code thus far, I think  you want
kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked.

--------------------------------------------------------------------------
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: How to capture audio generated by a render callback, iOS
      • From: Tim Kemp <email@hidden>
References: 
 >Re: How to capture audio generated by a render callback, iOS (From: Tim Kemp <email@hidden>)
 >Re: How to capture audio generated by a render callback, iOS (From: Joel Reymont <email@hidden>)

  • Prev by Date: Re: How to capture audio generated by a render callback, iOS
  • Next by Date: Re: How to capture audio generated by a render callback, iOS
  • Previous by thread: Re: How to capture audio generated by a render callback, iOS
  • Next by thread: Re: How to capture audio generated by a render callback, iOS
  • Index(es):
    • Date
    • Thread