• 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 10:50:25 -0500

Remove the big endian flags and try again.

I did so: changed my RemoteIO ASBD to use kAudioUnitFlagsCanonical. On the device and simulator I get identical, correctly pitched but garbled sound as before.

I am generating like so:

AudioBuffer *leftAudioBuffer = &buffers->mBuffers[0];
    AudioBuffer *rightAudioBuffer = &buffers->mBuffers[1];
    SInt16 *leftData = (SInt16 *) leftAudioBuffer->mData;
    SInt16 *rightData = (SInt16 *) rightAudioBuffer->mData;
        
    engine->getStereoSamples(_tmpBuf, numFrames);
    for (int i = 0; i < numFrames; i++) {
        leftData[i] = OSSwapHostToLittleConstInt16(_tmpBuf[i].left * INT16_MAX);
        rightData[i] = OSSwapHostToLittleConstInt16(_tmpBuf[i].right * INT16_MAX);
    }
        
    return noErr;

Tried various OSSwapXXtoYY with identical results each time, and no swap also with identical results. The floats (ie _tmpBuf[i].left and .right) are in the range -1.0..1.0 as they should be.

Turned off the recording stuff for now until I've pinned down the correct generation code.

On 6 Dec 2012, at 10:12, Joel Reymont wrote:

On Thu, Dec 6, 2012 at 2:58 PM, Tim Kemp <email@hidden> wrote:
It's required for extended audio file services.

I don't think so.

Plus, you are not doing little to big endian conversion in your code,
hence the garbled data.

Remove the big endian flags and try again.

--------------------------------------------------------------------------
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: 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