title: AudioBufferList contents in remoteIO audio unit playback callback
body: <p>I'd like to "intercept" audio data on its way to the iOS device's speaker. I believe this can be done using remoteIO audio units and callbacks. In the playbackCallback below does ioData actually contain any audio data?</p>
  
  <pre><code>static OSStatus playbackCallback(void *inRefCon, 
                                   AudioUnitRenderActionFlags *ioActionFlags, 
                                   const AudioTimeStamp *inTimeStamp, 
                                   UInt32 inBusNumber, 
                                   UInt32 inNumberFrames, 
                                   AudioBufferList *ioData) { ... } 
  </code></pre>
  
  <p>I'm confused because logging info about ioData seems to imply it contains audio data...</p>
  
  <pre><code>// if (ioData-&gt;mNumberBuffers &gt; 0)
  AudioBuffer buffer = ioData-&gt;mBuffers[0];
  NSLog(@"buffer.mNumberChannels: %ld", buffer.mNumberChannels); // prints 2
  NSLog(@"buffer.mDataByteSize  : %ld", buffer.mDataByteSize); // prints 4096
  </code></pre>
  
  <p>However creating a CMSampleBufferRef from the contents of ioData and writing it to a CoreAudioFile using an AVAssetWriter yields a silent file. The length of the output file seems fine (a few seconds) but opening the file in Audacity for example shows a flatline.</p>
  
  <p>After reading numerous SO posts and experimenting with lots of remoteIO audio unit sample code I'm starting to wonder if ioData above contains pre-sized but empty buffers that should be populated in the playbackCallback.</p>