SlideShare a Scribd company logo
1 of 90
Core Audio in iOS 6
         Chris Adamson ā€¢ @invalidname
                CocoaConf PDX
                October 27, 2012



Slides and sample code will be available later today
Plug!
The Reviews Are In!
The Reviews Are In!
The Reviews Are In!
The Reviews Are In!
Legitimate copies!
ā€¢ Amazon (paper or Kindle)
ā€¢ Barnes & Noble (paper or Nook)
ā€¢ Apple (iBooks)
ā€¢ Direct from InformIT (paper, eBook [.epub
  + .mobi + .pdf], or Bundle)
 ā€¢ 35% off with code COREAUDIO3174
What Youā€™ll Learn

ā€¢ What Core Audio does and doesnā€™t do
ā€¢ When to use and not use it
ā€¢ Whatā€™s new in Core Audio for iOS 6
Simple things should be simple,
complex things should be possible.
             ā€“Alan Kay
AV Foundation,
 Media Player

           Simple things should be simple,
         complex things should be possible.
                      ā€“Alan Kay
AV Foundation,
 Media Player

           Simple things should be simple,
         complex things should be possible.
                      ā€“Alan Kay
                                   Core Audio
Core Audio

ā€¢ Low-level C framework for processing
  audio
 ā€¢ Capture, play-out, real-time or off-line
    processing
ā€¢ The ā€œcomplex things should be possibleā€
  part of audio on OS X and iOS
Chrisā€™ CA Taxonomy
ā€¢ Engines: process streams of audio
 ā€¢ Capture, play-out, mixing, effects
    processing
ā€¢ Helpers: deal with formats, encodings, etc.
 ā€¢ File I/O, stream I/O, format conversion,
    iOS ā€œsessionā€ management
Helpers: Audio File

ā€¢ Read from / write to multiple audio ļ¬le
  types (.aiff, .wav, .caf, .m4a, .mp3) in a
  content-agnostic way
ā€¢ Get metadata (data format, duration,
  iTunes/ID3 info)
Helpers: Audio File
         Stream

ā€¢ Read audio from non-random-access
  source like a network stream
ā€¢ Discover encoding and encapsulation on
  the ļ¬‚y, then deliver audio packets to client
  application
Helpers: Converters

ā€¢ Convert buffers of audio to and from
  different encodings
ā€¢ One side must be in an uncompressed
  format (i.e., Linear PCM)
Helpers: ExtAudioFile

ā€¢ Combine ļ¬le I/O and format conversion
ā€¢ Read a compressed ļ¬le into PCM buffers
ā€¢ Write PCM buffers into a compressed ļ¬le
Helpers: Audio Session
ā€¢ iOS-only API to negotiate use of audio
  resources with the rest of the system
ā€¢ Deetermine whether your app mixes with
  other appsā€™ audio, honors ring/silent
  switch, can play in background, etc.
ā€¢ Gets notiļ¬ed of audio interruptions
ā€¢ See also AVAudioSession
Engines: Audio Units

ā€¢ Low-latency (~10ms) processing of
  capture/play-out audio data
ā€¢ Effects, mixing, etc.
ā€¢ Connect units manually or via an AUGraph
ā€¢ Much more on this topic momentarilyā€¦
Engines: Audio Queue
ā€¢ Convenience API for recording or play-out,
  built atop audio units
ā€¢ Rather than processing on-demand and on
  Core Audioā€™s thread, your callback provides
  or receives buffers of audio (at whatever size
  is convenient to you)
ā€¢ Higher latency, naturally
ā€¢ Supports compressed formats (MP3, AAC)
Engines: Open AL

ā€¢ API for 3D spatialized audio, implemented
  atop audio units
ā€¢ Set a sourceā€™s properties (x/y/z
  coordinates, orientation, audio buffer, etc.),
  OpenAL renders what it sounds like to the
  listener from that location
Engines and Helpers
ā€¢   Audio Units   ā€¢   Audio File

ā€¢   Audio Queue   ā€¢   Audio File Stream

ā€¢   Open AL       ā€¢   Audio Converter

                  ā€¢   ExtAudioFile

                  ā€¢   Audio Session
Audio Units
Audio Unit


  AUSomething
Types of Audio Units
ā€¢ Output (which also do input)
ā€¢ Generator
ā€¢ Converter
ā€¢ Effect
ā€¢ Mixer
ā€¢ Music
Pull Model


 AUSomething
Pull Model


 AUSomething
               AudioUnitRender()
Pull Model



AUSomethingElse   AUSomething
Buses (aka, Elements)

   AUSomethingElse




                     AUSomething




   AUSomethingElse
AUGraph

AUSomethingElse




                  AUSomething




AUSomethingElse
Render Callbacks
OSStatus converterInputRenderCallback (void *inRefCon,
                                        AudioUnitRenderActionFlags *ioActionFlags,
                                        const AudioTimeStamp *inTimeStamp,
                                        UInt32 inBusNumber,
                                        UInt32 inNumberFrames,
                                        AudioBufferList * ioData) {
       CCFWebRadioPlayer *player = (__bridge CCFWebRadioPlayer*) inRefCon;

      // read from buffer
      ioData->mBuffers[0].mData = player.preRenderData;

      return noErr;
}



                                                                                     AUSomething




                                                          AUSomethingElse
AURemoteIO
ā€¢ Output unit used for play-out, capture
ā€¢ A Core Audio thread repeatedly and
  automatically calls AudioUnitRender()
ā€¢ Must set EnableIO property to explicitly
  enable capture and/or play-out
  ā€¢ Capture requires setting appropriate
    AudioSession category
Create AURemoteIO
CheckError(NewAUGraph(&_auGraph),
! !     "couldn't create au graph");
!
CheckError(AUGraphOpen(_auGraph),
! !     "couldn't open au graph");
!
AudioComponentDescription componentDesc;
componentDesc.componentType = kAudioUnitType_Output;
componentDesc.componentSubType = kAudioUnitSubType_RemoteIO;
componentDesc.componentManufacturer =
             kAudioUnitManufacturer_Apple;
!
AUNode remoteIONode;
CheckError(AUGraphAddNode(_auGraph,
! ! ! ! ! !      &componentDesc,
! ! ! ! ! !      &remoteIONode),
! !     "couldn't add remote io node");
Getting an AudioUnit
        from AUNode

!   CheckError(AUGraphNodeInfo(self.auGraph,
!   ! ! ! ! ! !       remoteIONode,
!   ! ! ! ! ! !       NULL,
!   ! ! ! ! ! !       &_remoteIOUnit),
!   ! !     "couldn't get remote io unit from node");
AURemoteIO Buses


     AURemoteIO
AURemoteIO Buses


     AURemoteIO
                       bus 0
                  to output H/W
AURemoteIO Buses


           AURemoteIO
  bus 0                      bus 0
from app                to output H/W
AURemoteIO Buses

     bus 1
from input H/W
                 AURemoteIO
    bus 0                          bus 0
  from app                    to output H/W
AURemoteIO Buses

     bus 1                        bus 1
from input H/W                   to app
                 AURemoteIO
    bus 0                          bus 0
  from app                    to output H/W
EnableIO
!   UInt32 oneFlag = 1;
!   UInt32 busZero = 0;
!   CheckError(AudioUnitSetProperty(self.remoteIOUnit,
!   ! ! ! ! ! ! ! ! kAudioOutputUnitProperty_EnableIO,
!   ! ! ! ! ! ! ! ! kAudioUnitScope_Output,
!   ! ! ! ! ! ! ! ! busZero,
!   ! ! ! ! ! ! ! ! &oneFlag,
!   ! ! ! ! ! ! ! ! sizeof(oneFlag)),
!   ! !     "couldn't enable remote io output");
!   UInt32 busOne = 1;
!   CheckError(AudioUnitSetProperty(self.remoteIOUnit,
!   ! ! ! ! ! ! ! ! kAudioOutputUnitProperty_EnableIO,
!   ! ! ! ! ! ! ! ! kAudioUnitScope_Input,
!   ! ! ! ! ! ! ! ! busOne,
!   ! ! ! ! ! ! ! ! &oneFlag,
!   ! ! ! ! ! ! ! ! sizeof(oneFlag)),
!   ! !     "couldn't enable remote io input");
Pass Through

     bus 1
from input H/W
                 AURemoteIO
                                   bus 0
                              to output H/W
Connect In to Out
!   UInt32 busZero = 0;
!   UInt32 busOne = 1;
!   CheckError(AUGraphConnectNodeInput(self.auGraph,
!   ! ! ! ! ! ! ! !        remoteIONode,
!   ! ! ! ! ! ! ! !        busOne,
!   ! ! ! ! ! ! ! !        remoteIONode,
!   ! ! ! ! ! ! ! !        busZero),
!   ! !     "couldn't connect remote io bus 1 to 0");
Pass-Through with Effect

                       AUEffect




          bus 1
     from input H/W
                      AURemoteIO
                                        bus 0
                                   to output H/W
Demo: Delay Effect
      New in iOS 6!
Creating the AUDelay
! componentDesc.componentType = kAudioUnitType_Effect;
! componentDesc.componentSubType = kAudioUnitSubType_Delay;
! componentDesc.componentManufacturer =
           kAudioUnitManufacturer_Apple;
!
! AUNode effectNode;
! CheckError(AUGraphAddNode(self.auGraph,
! ! ! ! ! ! !      &componentDesc,
! ! ! ! ! ! !      &effectNode),
! ! !     "couldn't create effect node");
! AudioUnit effectUnit;
! CheckError(AUGraphNodeInfo(self.auGraph,
! ! ! ! ! ! !        effectNode,
! ! ! ! ! ! !        NULL,
! ! ! ! ! ! !        &effectUnit),
! ! !     "couldn't get effect unit from node");
The problem with effect
         units
ā€¢ Audio Units available since iPhone OS 2.0
  prefer int formats
ā€¢ Effect units arrived with iOS 5 (arm7 era)
  and only work with ļ¬‚oat format
ā€¢ Have to set the AUEffect unitā€™s format on
  AURemoteIO
Setting formats
!   AudioStreamBasicDescription effectDataFormat;
!   UInt32 propSize = sizeof (effectDataFormat);
!   CheckError(AudioUnitGetProperty(effectUnit,
!   ! ! ! ! ! ! ! ! kAudioUnitProperty_StreamFormat,
!   ! ! ! ! ! ! ! ! kAudioUnitScope_Output,
!   ! ! ! ! ! ! ! ! busZero,
!   ! ! ! ! ! ! ! ! &effectDataFormat,
!   ! ! ! ! ! ! ! ! &propSize),
!   ! !     "couldn't read effect format");
!   CheckError(AudioUnitSetProperty(self.remoteIOUnit,
!   ! ! ! ! ! ! ! ! kAudioUnitProperty_StreamFormat,
!   ! ! ! ! ! ! ! ! kAudioUnitScope_Output,
!   ! ! ! ! ! ! ! ! busOne,
!   ! ! ! ! ! ! ! ! &effectDataFormat,
!   ! ! ! ! ! ! ! ! propSize),
!   ! !     "couldn't set bus one output format");

    Then repeat AudioUnitSetProperty() for input scope / bus 0
AUNewTimePitch

ā€¢ New in iOS 6!
ā€¢ Allows you to change pitch independent of
  time, or time independent of pitch
ā€¢ How do you use it?
AUTimePitch
!   AudioComponentDescription effectcd = {0};
!   effectcd.componentType = kAudioUnitType_FormatConverter;
!   effectcd.componentSubType = kAudioUnitSubType_NewTimePitch;
!   effectcd.componentManufacturer = kAudioUnitManufacturer_Apple;
!
!   AUNode effectNode;
!   CheckError(AUGraphAddNode(self.auGraph,
!   ! ! ! ! ! !       &effectcd,
!   ! ! ! ! ! !       &effectNode),
!   ! !      "couldn't get effect node [time/pitch]");




    Notice the type is AUFormatConverter, not AUEffect
AudioUnitParameters.h
      // Parameters for AUNewTimePitch
      enum {
      ! ! // Global, rate, 1/32 -> 32.0, 1.0
      ! kNewTimePitchParam_Rate! ! ! ! ! ! =
                               !                  0,
      ! ! // Global, Cents, -2400 -> 2400, 1.0
      ! kNewTimePitchParam_Pitch! ! ! ! ! ! =     1,
      ! ! // Global, generic, 3.0 -> 32.0, 8.0
      ! kNewTimePitchParam_Overlap! ! ! ! ! !     = 4,
      ! ! // Global, Boolean, 0->1, 1
      ! kNewTimePitchParam_EnablePeakLocking! !   ! = 6
      };



This is the entire documentation for the AUNewTimePitch parameters
AUNewTimePitch
      parameters
ā€¢ Rate: kNewTimePitchParam_Rate takes a
  Float32 rate from 1/32 speed to 32x
  speed.
 ā€¢ Use powers of 2: 1/32, 1/16, ā€¦, 2, 4, 8ā€¦
ā€¢ Pitch: kNewTimePitchParam_Pitch takes
  a Float32 representing cents, meaning
  1/100 of a musical semitone
Pitch shifting


ā€¢ Pitch can vary, time does not
ā€¢ Suitable for real-time sources, such as audio
  capture
Demo: Pitch Shift
     New in iOS 6!
Rate shifting
ā€¢ Rate can vary, pitch does not
 ā€¢ Think of 1.5x and 2x speed modes in
    Podcasts app
ā€¢ Not suitable for real-time sources, as data
  will be consumed faster. Files work well.
  ā€¢ Sources must be able to map time
    systems with
    kAudioUnitProperty_InputSamplesInOutput
Demo: Rate Shift
     New in iOS 6!
AUSplitter

                   AUSomethingElse




AUSplitter



                   AUSomethingElse




         New in iOS 6!
AUMatrixMixer
AUSomethingElse



                                     AUSomethingElse




AUSomethingElse      AUMatrixMixer



                                     AUSomethingElse




AUSomethingElse




                  New in iOS 6!
Audio Queues
(and the APIs that help them)
AudioQueue
ā€¢ Easier than AURemoteIO - provide data
  when you want to, less time pressure, can
  accept or provide compressed formats
  (MP3, AAC)
ā€¢ Recording queue - receive buffers of
  captured audio in a callback
ā€¢ Play-out queue - enqueue buffers of audio
  to play, optionally reļ¬ll in a callback
AudioQueue


   2   1   0
Common AQ scenarios
ā€¢ File player - Read from ļ¬le and ā€œprimeā€
  queue buffers, start queue, when called
  back with used buffer, reļ¬ll from next part
  of ļ¬le
ā€¢ Synthesis - Maintain state in your own
  code, write raw samples into buffers during
  callbacks
Web Radio

ā€¢ Thursday classā€™ third project
ā€¢ Use Audio File Stream Services to pick out
  audio data from a network stream
ā€¢ Enqueue these packets as new AQ buffers
ā€¢ Dispose used buffers in callback
Parsing web radio
Parsing web radio
NSURLConnection delivers
NSData buffers, containing audio
and framing info. We pass it to              NSData                 NSData
Audio File Services.               Packets      Packets   Packets   Packets   Packets
Parsing web radio
NSURLConnection delivers
NSData buffers, containing audio
and framing info. We pass it to                NSData                         NSData
Audio File Services.                 Packets        Packets         Packets   Packets   Packets




                                     Packets   Packets
Audio File Services calls us back
with parsed packets of audio data.   Packets   Packets    Packets
Parsing web radio
NSURLConnection delivers
NSData buffers, containing audio
and framing info. We pass it to                NSData                                  NSData
Audio File Services.                 Packets        Packets              Packets       Packets   Packets




                                     Packets   Packets
Audio File Services calls us back
with parsed packets of audio data.   Packets   Packets       Packets




We create an AudioQueueBuffer
                                                Packets                      Packets
with those packets and enqueue it                 Packets
                                                    2          Packets
                                                                 1              0
for play-out.
                                                   Packets                   Packets
A complex thing!

ā€¢ What if we want to see that data after itā€™s
  been decoded to PCM and is about to be
  played?
  ā€¢ e.g., spectrum analysis, effects, visualizers
ā€¢ AudioQueue design is ā€œļ¬re-and-forgetā€
AudioQueue Tap!




http://www.last.fm/music/Spinal+Tap
AudioQueueProcessingTap

ā€¢ Set as a property on the Audio Queue
ā€¢ Calls back to your function with decoded
  (PCM) audio data
ā€¢ Three types: pre- or post- effects (that the
  AQ performs), or siphon. First two can
  modify the data.
ā€¢ Only documentation is in AudioQueue.h
Creating an AQ Tap
!   !     // create the tap
!   !     UInt32 maxFrames = 0;
!   !     AudioStreamBasicDescription tapFormat = {0};
!   !     AudioQueueProcessingTapRef tapRef;
!   !     CheckError(AudioQueueProcessingTapNew(audioQueue,
!   !     ! ! ! ! ! ! ! ! !       tapProc,
!   !     ! ! ! ! ! ! ! ! !       (__bridge void *)(player),
!   !     ! ! ! ! ! ! ! ! !       kAudioQueueProcessingTap_PreEffects,
!   !     ! ! ! ! ! ! ! ! !       &maxFrames,
!   !     ! ! ! ! ! ! ! ! !       &tapFormat,
!   !     ! ! ! ! ! ! ! ! !       &tapRef),
!   !     ! !     "couldn't create AQ tap");



        Notice that you receive maxFrames and tapFormat. These do not appear to be settable.
AQ Tap Proc
void tapProc (void *                            inClientData,
! ! !     AudioQueueProcessingTapRef       inAQTap,
! ! !     UInt32                           inNumberFrames,
! ! !     AudioTimeStamp *                 ioTimeStamp,
! ! !     UInt32 *                         ioFlags,
! ! !     UInt32 *                         outNumberFrames,
! ! !     AudioBufferList *                ioData) {
! CCFWebRadioPlayer *player =
        (__bridge CCFWebRadioPlayer*) inClientData;
! UInt32 getSourceFlags = 0;
! UInt32 getSourceFrames = 0;
! AudioQueueProcessingTapGetSourceAudio(inAQTap,
! ! ! ! ! ! ! ! ! !         inNumberFrames,
! ! ! ! ! ! ! ! ! !         ioTimeStamp,
! ! ! ! ! ! ! ! ! !         &getSourceFlags,
! ! ! ! ! ! ! ! ! !         &getSourceFrames,
! ! ! ! ! ! ! ! ! !         ioData);
  // then do something with ioData
  // ...
So what should we do
   with the audio?
So what should we do
   with the audio?


  Letā€™s apply our pitch-shift effect
Shouldnā€™t this work?


       AUEffect
Shouldnā€™t this work?


       AUEffect
                  AudioUnitRender()
AudioUnitRender()
ā€¢ Last argument is an AudioBufferList, whose
  AudioBuffer members have mData pointers
  ā€¢ If mData != NULL, audio unit does its
    thing with those samples
  ā€¢ If mData == NULL, audio data pulls from
    whatever itā€™s connected to
ā€¢ So we just call with AudioBufferList ioData
  we got from tap callback, right?
Psych!

ā€¢ AQ tap provides data as signed ints
ā€¢ Effect units only work with ļ¬‚oating point
ā€¢ We need to do an on-the-spot format
  conversion
invalidnameā€™s convert-
      and-effect recipe
      OSStatus converterInputRenderCallback (void *inRefCon,
                                              AudioUnitRenderActionFlags *ioActionFlags,
                                              const AudioTimeStamp *inTimeStamp,
                                              UInt32 inBusNumber,
                                              UInt32 inNumberFrames,
                                              AudioBufferList * ioData) {
             CCFWebRadioPlayer *player = (__bridge CCFWebRadioPlayer*) inRefCon;

            // read from buffer
            ioData->mBuffers[0].mData = player.preRenderData;

            return noErr;
      }




               AUConverter                               AUEffect                          AUConverter   AUGenericOutput




Note: red arrows are ļ¬‚oat format, yellow arrows are int
How it works

ā€¢ AUGraph: AUConverter ā†’ AUEffect ā†’
  AUConverter ā†’ AUGenericOutput
ā€¢ Top AUConverter is connected to a render
  callback function
The trick!
ā€¢ Copy mData pointer to a state variable and
  NULL it in ioData
ā€¢ Call AudioQueueRender() on output unit.
  The NULL makes it pull from the graph.
ā€¢ Top of the graph pulls on render callback,
  which gives it back the mData we copied
  off.
Yes, really
          This is the rest of tapProc()
! // copy off the ioData so the graph can read from it
  // in render callback
! player.preRenderData = ioData->mBuffers[0].mData;
! ioData->mBuffers[0].mData = NULL;
!
! OSStatus renderErr = noErr;
! AudioUnitRenderActionFlags actionFlags = 0;
! renderErr = AudioUnitRender(player.genericOutputUnit,
! ! ! ! ! ! ! ! &actionFlags,
! ! ! ! ! ! ! ! player.renderTimeStamp,
! ! ! ! ! ! ! ! 0,
! ! ! ! ! ! ! ! inNumberFrames,
! ! ! ! ! ! ! ! ioData);
! NSLog (@"AudioUnitRender, renderErr = %ld",renderErr);
}
Yes, really
  This is the render callback that supplies data to the intā†’ļ¬‚oat converter

OSStatus converterInputRenderCallback (void *inRefCon,
! ! ! ! ! ! ! ! !        AudioUnitRenderActionFlags *ioActionFlags,
! ! ! ! ! ! ! ! !        const AudioTimeStamp *inTimeStamp,
! ! ! ! ! ! ! ! !        UInt32 inBusNumber,
! ! ! ! ! ! ! ! !        UInt32 inNumberFrames,
! ! ! ! ! ! ! ! !        AudioBufferList * ioData) {
! CCFWebRadioPlayer *player =
               (__bridge CCFWebRadioPlayer*) inRefCon;
!
! // read from buffer
! ioData->mBuffers[0].mData = player.preRenderData;

! return noErr;
}
Demo: AQ Tap +
AUNewTimePitch
     New in iOS 6!
Other new stuff
Multi-Route
ā€¢ Ordinarily, one input or output is active:
  earpiece, speaker, headphones, dock-
  connected device
  ā€¢ ā€œLast in winsā€
ā€¢ With AV Session ā€œmulti-routeā€ category,
  you can use several at once
ā€¢ WWDC 2012 session 505
Utility classes moved
         again
ā€¢ C++ utilities, including the CARingBuffer
 ā€¢ < Xcode 4.3, installed into /Developer
 ā€¢ Xcode 4.3-4.4, optional download from
    developer.apple.com
  ā€¢ ā‰§ Xcode 4.5, sample code project ā€œCore
    Audio Utility Classesā€
Takeaways
ā€¢ Core Audio fundamentals never change
ā€¢ New stuff is added as properties, typedefs,
  enums, etc.
ā€¢ Watch the SDK API diffs document to ļ¬nd
  the new stuff
ā€¢ Hope you like header ļ¬les and
  experimentation
Q&A
ā€¢ Slides will be posted to slideshare.net/
  invalidname
ā€¢ Code will be linked from there and my blog
ā€¢ Watch CocoaConf PDX glassboard,
  @invalidname on Twitter/ADN, or [Time
  code]; blog for announcement
ā€¢ Thanks!

More Related Content

What's hot

Integrating Voice Through Adhearsion
Integrating Voice Through AdhearsionIntegrating Voice Through Adhearsion
Integrating Voice Through AdhearsionMojo Lingo
Ā 
Deep dive into Androidā€™s audio latency problem
Deep dive into Androidā€™s audio latency problemDeep dive into Androidā€™s audio latency problem
Deep dive into Androidā€™s audio latency problemSirawat Pitaksarit
Ā 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSLYoss Cohen
Ā 
Html5 game, websocket e arduino
Html5 game, websocket e arduino Html5 game, websocket e arduino
Html5 game, websocket e arduino Giuseppe Modarelli
Ā 
Squence Annotation
Squence AnnotationSquence Annotation
Squence AnnotationLuke Finlay
Ā 
How you think the sound in your chosen example has been produced zelda
How you think the sound in your chosen example has been produced zeldaHow you think the sound in your chosen example has been produced zelda
How you think the sound in your chosen example has been produced zeldaconor0994
Ā 

What's hot (6)

Integrating Voice Through Adhearsion
Integrating Voice Through AdhearsionIntegrating Voice Through Adhearsion
Integrating Voice Through Adhearsion
Ā 
Deep dive into Androidā€™s audio latency problem
Deep dive into Androidā€™s audio latency problemDeep dive into Androidā€™s audio latency problem
Deep dive into Androidā€™s audio latency problem
Ā 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
Ā 
Html5 game, websocket e arduino
Html5 game, websocket e arduino Html5 game, websocket e arduino
Html5 game, websocket e arduino
Ā 
Squence Annotation
Squence AnnotationSquence Annotation
Squence Annotation
Ā 
How you think the sound in your chosen example has been produced zelda
How you think the sound in your chosen example has been produced zeldaHow you think the sound in your chosen example has been produced zelda
How you think the sound in your chosen example has been produced zelda
Ā 

Similar to Core Audio in iOS 6: An In-Depth Look at the Low-Level Audio Framework

Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)Chris Adamson
Ā 
Get On The Audiobus (CocoaConf Atlanta, November 2013)
Get On The Audiobus (CocoaConf Atlanta, November 2013)Get On The Audiobus (CocoaConf Atlanta, November 2013)
Get On The Audiobus (CocoaConf Atlanta, November 2013)Chris Adamson
Ā 
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]Chris Adamson
Ā 
Openframworks x Mobile
Openframworks x MobileOpenframworks x Mobile
Openframworks x MobileJanet Huang
Ā 
Core MIDI and Friends
Core MIDI and FriendsCore MIDI and Friends
Core MIDI and FriendsChris Adamson
Ā 
Guitar Effects with the HTML5 Audio API
Guitar Effects with the HTML5 Audio APIGuitar Effects with the HTML5 Audio API
Guitar Effects with the HTML5 Audio APICathy Lill
Ā 
Arduino Workshop @ MSA University
Arduino Workshop @ MSA UniversityArduino Workshop @ MSA University
Arduino Workshop @ MSA UniversityAhmed Magdy Farid
Ā 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBob McCune
Ā 
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)Chris Adamson
Ā 
Core audio
Core audioCore audio
Core audioscussen
Ā 
[COSCUP 2013] Audio Competing
[COSCUP 2013] Audio Competing[COSCUP 2013] Audio Competing
[COSCUP 2013] Audio CompetingAlive Kuo
Ā 
Video Killed the Rolex Star (CocoaConf Columbus, July 2015)
Video Killed the Rolex Star (CocoaConf Columbus, July 2015)Video Killed the Rolex Star (CocoaConf Columbus, July 2015)
Video Killed the Rolex Star (CocoaConf Columbus, July 2015)Chris Adamson
Ā 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to GoCloudflare
Ā 
L18 applets
L18 appletsL18 applets
L18 appletsteach4uin
Ā 
Modulator p5: Make your Processing Sketches More Dynamic with Modulators
Modulator p5: Make your Processing Sketches More Dynamic with ModulatorsModulator p5: Make your Processing Sketches More Dynamic with Modulators
Modulator p5: Make your Processing Sketches More Dynamic with ModulatorsNathan Koch
Ā 
iPlayground: CarPlay and MFI Hearing Aids
iPlayground: CarPlay and MFI Hearing AidsiPlayground: CarPlay and MFI Hearing Aids
iPlayground: CarPlay and MFI Hearing AidsWeizhong Yang
Ā 
Setting Up An Interactive AudioInspector Demo
Setting Up An Interactive AudioInspector DemoSetting Up An Interactive AudioInspector Demo
Setting Up An Interactive AudioInspector DemoMediaservices
Ā 
Moving to modules
Moving to modulesMoving to modules
Moving to modulesSean Mize
Ā 
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with KamaeliaTimeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaeliakamaelian
Ā 

Similar to Core Audio in iOS 6: An In-Depth Look at the Low-Level Audio Framework (20)

Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)Get On The Audiobus (CocoaConf Boston, October 2013)
Get On The Audiobus (CocoaConf Boston, October 2013)
Ā 
Get On The Audiobus (CocoaConf Atlanta, November 2013)
Get On The Audiobus (CocoaConf Atlanta, November 2013)Get On The Audiobus (CocoaConf Atlanta, November 2013)
Get On The Audiobus (CocoaConf Atlanta, November 2013)
Ā 
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Ā 
Openframworks x Mobile
Openframworks x MobileOpenframworks x Mobile
Openframworks x Mobile
Ā 
Core MIDI and Friends
Core MIDI and FriendsCore MIDI and Friends
Core MIDI and Friends
Ā 
Guitar Effects with the HTML5 Audio API
Guitar Effects with the HTML5 Audio APIGuitar Effects with the HTML5 Audio API
Guitar Effects with the HTML5 Audio API
Ā 
Arduino Workshop @ MSA University
Arduino Workshop @ MSA UniversityArduino Workshop @ MSA University
Arduino Workshop @ MSA University
Ā 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngine
Ā 
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Ā 
Core audio
Core audioCore audio
Core audio
Ā 
[COSCUP 2013] Audio Competing
[COSCUP 2013] Audio Competing[COSCUP 2013] Audio Competing
[COSCUP 2013] Audio Competing
Ā 
Video Killed the Rolex Star (CocoaConf Columbus, July 2015)
Video Killed the Rolex Star (CocoaConf Columbus, July 2015)Video Killed the Rolex Star (CocoaConf Columbus, July 2015)
Video Killed the Rolex Star (CocoaConf Columbus, July 2015)
Ā 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
Ā 
L18 applets
L18 appletsL18 applets
L18 applets
Ā 
Modulator p5: Make your Processing Sketches More Dynamic with Modulators
Modulator p5: Make your Processing Sketches More Dynamic with ModulatorsModulator p5: Make your Processing Sketches More Dynamic with Modulators
Modulator p5: Make your Processing Sketches More Dynamic with Modulators
Ā 
Audio Mixing Console
Audio Mixing ConsoleAudio Mixing Console
Audio Mixing Console
Ā 
iPlayground: CarPlay and MFI Hearing Aids
iPlayground: CarPlay and MFI Hearing AidsiPlayground: CarPlay and MFI Hearing Aids
iPlayground: CarPlay and MFI Hearing Aids
Ā 
Setting Up An Interactive AudioInspector Demo
Setting Up An Interactive AudioInspector DemoSetting Up An Interactive AudioInspector Demo
Setting Up An Interactive AudioInspector Demo
Ā 
Moving to modules
Moving to modulesMoving to modules
Moving to modules
Ā 
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with KamaeliaTimeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Ā 

More from Chris Adamson

Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)Chris Adamson
Ā 
Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)Chris Adamson
Ā 
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Chris Adamson
Ā 
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...Chris Adamson
Ā 
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineCocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineChris Adamson
Ā 
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineForward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineChris Adamson
Ā 
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Chris Adamson
Ā 
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)Chris Adamson
Ā 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Chris Adamson
Ā 
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Chris Adamson
Ā 
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Chris Adamson
Ā 
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Chris Adamson
Ā 
Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Chris Adamson
Ā 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasChris Adamson
Ā 
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)Chris Adamson
Ā 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Chris Adamson
Ā 
Stupid Video Tricks
Stupid Video TricksStupid Video Tricks
Stupid Video TricksChris Adamson
Ā 
Introduction to the Roku SDK
Introduction to the Roku SDKIntroduction to the Roku SDK
Introduction to the Roku SDKChris Adamson
Ā 
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)Chris Adamson
Ā 
iOS Media APIs (MobiDevDay Detroit, May 2013)
iOS Media APIs (MobiDevDay Detroit, May 2013)iOS Media APIs (MobiDevDay Detroit, May 2013)
iOS Media APIs (MobiDevDay Detroit, May 2013)Chris Adamson
Ā 

More from Chris Adamson (20)

Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Whatever Happened to Visual Novel Anime? (AWA/Youmacon 2018)
Ā 
Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Whatever Happened to Visual Novel Anime? (JAFAX 2018)
Ā 
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Media Frameworks Versus Swift (Swift by Northwest, October 2017)
Ā 
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Fall Premieres: Media Frameworks in iOS 11, macOS 10.13, and tvOS 11 (CocoaCo...
Ā 
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is FineCocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
CocoaConf Chicago 2017: Media Frameworks and Swift: This Is Fine
Ā 
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineForward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Ā 
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Ā 
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Building A Streaming Apple TV App (CocoaConf San Jose, Nov 2016)
Ā 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)
Ā 
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Building A Streaming Apple TV App (CocoaConf DC, Sept 2016)
Ā 
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Ā 
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Ā 
Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014
Ā 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las Vegas
Ā 
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Core Image: The Most Fun API You're Not Using (CocoaConf Columbus 2014)
Ā 
Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)Stupid Video Tricks (CocoaConf DC, March 2014)
Stupid Video Tricks (CocoaConf DC, March 2014)
Ā 
Stupid Video Tricks
Stupid Video TricksStupid Video Tricks
Stupid Video Tricks
Ā 
Introduction to the Roku SDK
Introduction to the Roku SDKIntroduction to the Roku SDK
Introduction to the Roku SDK
Ā 
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Glitch-Free A/V Encoding (CocoaConf Boston, October 2013)
Ā 
iOS Media APIs (MobiDevDay Detroit, May 2013)
iOS Media APIs (MobiDevDay Detroit, May 2013)iOS Media APIs (MobiDevDay Detroit, May 2013)
iOS Media APIs (MobiDevDay Detroit, May 2013)
Ā 

Recently uploaded

šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
Ā 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
Ā 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
Ā 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
Ā 

Recently uploaded (20)

šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ā 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Ā 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Ā 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Ā 

Core Audio in iOS 6: An In-Depth Look at the Low-Level Audio Framework

  • 1. Core Audio in iOS 6 Chris Adamson ā€¢ @invalidname CocoaConf PDX October 27, 2012 Slides and sample code will be available later today
  • 7. Legitimate copies! ā€¢ Amazon (paper or Kindle) ā€¢ Barnes & Noble (paper or Nook) ā€¢ Apple (iBooks) ā€¢ Direct from InformIT (paper, eBook [.epub + .mobi + .pdf], or Bundle) ā€¢ 35% off with code COREAUDIO3174
  • 8. What Youā€™ll Learn ā€¢ What Core Audio does and doesnā€™t do ā€¢ When to use and not use it ā€¢ Whatā€™s new in Core Audio for iOS 6
  • 9.
  • 10. Simple things should be simple, complex things should be possible. ā€“Alan Kay
  • 11. AV Foundation, Media Player Simple things should be simple, complex things should be possible. ā€“Alan Kay
  • 12. AV Foundation, Media Player Simple things should be simple, complex things should be possible. ā€“Alan Kay Core Audio
  • 13. Core Audio ā€¢ Low-level C framework for processing audio ā€¢ Capture, play-out, real-time or off-line processing ā€¢ The ā€œcomplex things should be possibleā€ part of audio on OS X and iOS
  • 14. Chrisā€™ CA Taxonomy ā€¢ Engines: process streams of audio ā€¢ Capture, play-out, mixing, effects processing ā€¢ Helpers: deal with formats, encodings, etc. ā€¢ File I/O, stream I/O, format conversion, iOS ā€œsessionā€ management
  • 15. Helpers: Audio File ā€¢ Read from / write to multiple audio ļ¬le types (.aiff, .wav, .caf, .m4a, .mp3) in a content-agnostic way ā€¢ Get metadata (data format, duration, iTunes/ID3 info)
  • 16. Helpers: Audio File Stream ā€¢ Read audio from non-random-access source like a network stream ā€¢ Discover encoding and encapsulation on the ļ¬‚y, then deliver audio packets to client application
  • 17. Helpers: Converters ā€¢ Convert buffers of audio to and from different encodings ā€¢ One side must be in an uncompressed format (i.e., Linear PCM)
  • 18. Helpers: ExtAudioFile ā€¢ Combine ļ¬le I/O and format conversion ā€¢ Read a compressed ļ¬le into PCM buffers ā€¢ Write PCM buffers into a compressed ļ¬le
  • 19. Helpers: Audio Session ā€¢ iOS-only API to negotiate use of audio resources with the rest of the system ā€¢ Deetermine whether your app mixes with other appsā€™ audio, honors ring/silent switch, can play in background, etc. ā€¢ Gets notiļ¬ed of audio interruptions ā€¢ See also AVAudioSession
  • 20. Engines: Audio Units ā€¢ Low-latency (~10ms) processing of capture/play-out audio data ā€¢ Effects, mixing, etc. ā€¢ Connect units manually or via an AUGraph ā€¢ Much more on this topic momentarilyā€¦
  • 21. Engines: Audio Queue ā€¢ Convenience API for recording or play-out, built atop audio units ā€¢ Rather than processing on-demand and on Core Audioā€™s thread, your callback provides or receives buffers of audio (at whatever size is convenient to you) ā€¢ Higher latency, naturally ā€¢ Supports compressed formats (MP3, AAC)
  • 22. Engines: Open AL ā€¢ API for 3D spatialized audio, implemented atop audio units ā€¢ Set a sourceā€™s properties (x/y/z coordinates, orientation, audio buffer, etc.), OpenAL renders what it sounds like to the listener from that location
  • 23. Engines and Helpers ā€¢ Audio Units ā€¢ Audio File ā€¢ Audio Queue ā€¢ Audio File Stream ā€¢ Open AL ā€¢ Audio Converter ā€¢ ExtAudioFile ā€¢ Audio Session
  • 25. Audio Unit AUSomething
  • 26. Types of Audio Units ā€¢ Output (which also do input) ā€¢ Generator ā€¢ Converter ā€¢ Effect ā€¢ Mixer ā€¢ Music
  • 28. Pull Model AUSomething AudioUnitRender()
  • 30. Buses (aka, Elements) AUSomethingElse AUSomething AUSomethingElse
  • 31. AUGraph AUSomethingElse AUSomething AUSomethingElse
  • 32. Render Callbacks OSStatus converterInputRenderCallback (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList * ioData) { CCFWebRadioPlayer *player = (__bridge CCFWebRadioPlayer*) inRefCon; // read from buffer ioData->mBuffers[0].mData = player.preRenderData; return noErr; } AUSomething AUSomethingElse
  • 33. AURemoteIO ā€¢ Output unit used for play-out, capture ā€¢ A Core Audio thread repeatedly and automatically calls AudioUnitRender() ā€¢ Must set EnableIO property to explicitly enable capture and/or play-out ā€¢ Capture requires setting appropriate AudioSession category
  • 34. Create AURemoteIO CheckError(NewAUGraph(&_auGraph), ! ! "couldn't create au graph"); ! CheckError(AUGraphOpen(_auGraph), ! ! "couldn't open au graph"); ! AudioComponentDescription componentDesc; componentDesc.componentType = kAudioUnitType_Output; componentDesc.componentSubType = kAudioUnitSubType_RemoteIO; componentDesc.componentManufacturer = kAudioUnitManufacturer_Apple; ! AUNode remoteIONode; CheckError(AUGraphAddNode(_auGraph, ! ! ! ! ! ! &componentDesc, ! ! ! ! ! ! &remoteIONode), ! ! "couldn't add remote io node");
  • 35. Getting an AudioUnit from AUNode ! CheckError(AUGraphNodeInfo(self.auGraph, ! ! ! ! ! ! ! remoteIONode, ! ! ! ! ! ! ! NULL, ! ! ! ! ! ! ! &_remoteIOUnit), ! ! ! "couldn't get remote io unit from node");
  • 36. AURemoteIO Buses AURemoteIO
  • 37. AURemoteIO Buses AURemoteIO bus 0 to output H/W
  • 38. AURemoteIO Buses AURemoteIO bus 0 bus 0 from app to output H/W
  • 39. AURemoteIO Buses bus 1 from input H/W AURemoteIO bus 0 bus 0 from app to output H/W
  • 40. AURemoteIO Buses bus 1 bus 1 from input H/W to app AURemoteIO bus 0 bus 0 from app to output H/W
  • 41. EnableIO ! UInt32 oneFlag = 1; ! UInt32 busZero = 0; ! CheckError(AudioUnitSetProperty(self.remoteIOUnit, ! ! ! ! ! ! ! ! ! kAudioOutputUnitProperty_EnableIO, ! ! ! ! ! ! ! ! ! kAudioUnitScope_Output, ! ! ! ! ! ! ! ! ! busZero, ! ! ! ! ! ! ! ! ! &oneFlag, ! ! ! ! ! ! ! ! ! sizeof(oneFlag)), ! ! ! "couldn't enable remote io output"); ! UInt32 busOne = 1; ! CheckError(AudioUnitSetProperty(self.remoteIOUnit, ! ! ! ! ! ! ! ! ! kAudioOutputUnitProperty_EnableIO, ! ! ! ! ! ! ! ! ! kAudioUnitScope_Input, ! ! ! ! ! ! ! ! ! busOne, ! ! ! ! ! ! ! ! ! &oneFlag, ! ! ! ! ! ! ! ! ! sizeof(oneFlag)), ! ! ! "couldn't enable remote io input");
  • 42. Pass Through bus 1 from input H/W AURemoteIO bus 0 to output H/W
  • 43. Connect In to Out ! UInt32 busZero = 0; ! UInt32 busOne = 1; ! CheckError(AUGraphConnectNodeInput(self.auGraph, ! ! ! ! ! ! ! ! ! remoteIONode, ! ! ! ! ! ! ! ! ! busOne, ! ! ! ! ! ! ! ! ! remoteIONode, ! ! ! ! ! ! ! ! ! busZero), ! ! ! "couldn't connect remote io bus 1 to 0");
  • 44. Pass-Through with Effect AUEffect bus 1 from input H/W AURemoteIO bus 0 to output H/W
  • 45. Demo: Delay Effect New in iOS 6!
  • 46. Creating the AUDelay ! componentDesc.componentType = kAudioUnitType_Effect; ! componentDesc.componentSubType = kAudioUnitSubType_Delay; ! componentDesc.componentManufacturer = kAudioUnitManufacturer_Apple; ! ! AUNode effectNode; ! CheckError(AUGraphAddNode(self.auGraph, ! ! ! ! ! ! ! &componentDesc, ! ! ! ! ! ! ! &effectNode), ! ! ! "couldn't create effect node"); ! AudioUnit effectUnit; ! CheckError(AUGraphNodeInfo(self.auGraph, ! ! ! ! ! ! ! effectNode, ! ! ! ! ! ! ! NULL, ! ! ! ! ! ! ! &effectUnit), ! ! ! "couldn't get effect unit from node");
  • 47. The problem with effect units ā€¢ Audio Units available since iPhone OS 2.0 prefer int formats ā€¢ Effect units arrived with iOS 5 (arm7 era) and only work with ļ¬‚oat format ā€¢ Have to set the AUEffect unitā€™s format on AURemoteIO
  • 48. Setting formats ! AudioStreamBasicDescription effectDataFormat; ! UInt32 propSize = sizeof (effectDataFormat); ! CheckError(AudioUnitGetProperty(effectUnit, ! ! ! ! ! ! ! ! ! kAudioUnitProperty_StreamFormat, ! ! ! ! ! ! ! ! ! kAudioUnitScope_Output, ! ! ! ! ! ! ! ! ! busZero, ! ! ! ! ! ! ! ! ! &effectDataFormat, ! ! ! ! ! ! ! ! ! &propSize), ! ! ! "couldn't read effect format"); ! CheckError(AudioUnitSetProperty(self.remoteIOUnit, ! ! ! ! ! ! ! ! ! kAudioUnitProperty_StreamFormat, ! ! ! ! ! ! ! ! ! kAudioUnitScope_Output, ! ! ! ! ! ! ! ! ! busOne, ! ! ! ! ! ! ! ! ! &effectDataFormat, ! ! ! ! ! ! ! ! ! propSize), ! ! ! "couldn't set bus one output format"); Then repeat AudioUnitSetProperty() for input scope / bus 0
  • 49. AUNewTimePitch ā€¢ New in iOS 6! ā€¢ Allows you to change pitch independent of time, or time independent of pitch ā€¢ How do you use it?
  • 50. AUTimePitch ! AudioComponentDescription effectcd = {0}; ! effectcd.componentType = kAudioUnitType_FormatConverter; ! effectcd.componentSubType = kAudioUnitSubType_NewTimePitch; ! effectcd.componentManufacturer = kAudioUnitManufacturer_Apple; ! ! AUNode effectNode; ! CheckError(AUGraphAddNode(self.auGraph, ! ! ! ! ! ! ! &effectcd, ! ! ! ! ! ! ! &effectNode), ! ! ! "couldn't get effect node [time/pitch]"); Notice the type is AUFormatConverter, not AUEffect
  • 51. AudioUnitParameters.h // Parameters for AUNewTimePitch enum { ! ! // Global, rate, 1/32 -> 32.0, 1.0 ! kNewTimePitchParam_Rate! ! ! ! ! ! = ! 0, ! ! // Global, Cents, -2400 -> 2400, 1.0 ! kNewTimePitchParam_Pitch! ! ! ! ! ! = 1, ! ! // Global, generic, 3.0 -> 32.0, 8.0 ! kNewTimePitchParam_Overlap! ! ! ! ! ! = 4, ! ! // Global, Boolean, 0->1, 1 ! kNewTimePitchParam_EnablePeakLocking! ! ! = 6 }; This is the entire documentation for the AUNewTimePitch parameters
  • 52. AUNewTimePitch parameters ā€¢ Rate: kNewTimePitchParam_Rate takes a Float32 rate from 1/32 speed to 32x speed. ā€¢ Use powers of 2: 1/32, 1/16, ā€¦, 2, 4, 8ā€¦ ā€¢ Pitch: kNewTimePitchParam_Pitch takes a Float32 representing cents, meaning 1/100 of a musical semitone
  • 53. Pitch shifting ā€¢ Pitch can vary, time does not ā€¢ Suitable for real-time sources, such as audio capture
  • 54. Demo: Pitch Shift New in iOS 6!
  • 55. Rate shifting ā€¢ Rate can vary, pitch does not ā€¢ Think of 1.5x and 2x speed modes in Podcasts app ā€¢ Not suitable for real-time sources, as data will be consumed faster. Files work well. ā€¢ Sources must be able to map time systems with kAudioUnitProperty_InputSamplesInOutput
  • 56. Demo: Rate Shift New in iOS 6!
  • 57. AUSplitter AUSomethingElse AUSplitter AUSomethingElse New in iOS 6!
  • 58. AUMatrixMixer AUSomethingElse AUSomethingElse AUSomethingElse AUMatrixMixer AUSomethingElse AUSomethingElse New in iOS 6!
  • 59. Audio Queues (and the APIs that help them)
  • 60. AudioQueue ā€¢ Easier than AURemoteIO - provide data when you want to, less time pressure, can accept or provide compressed formats (MP3, AAC) ā€¢ Recording queue - receive buffers of captured audio in a callback ā€¢ Play-out queue - enqueue buffers of audio to play, optionally reļ¬ll in a callback
  • 61. AudioQueue 2 1 0
  • 62. Common AQ scenarios ā€¢ File player - Read from ļ¬le and ā€œprimeā€ queue buffers, start queue, when called back with used buffer, reļ¬ll from next part of ļ¬le ā€¢ Synthesis - Maintain state in your own code, write raw samples into buffers during callbacks
  • 63. Web Radio ā€¢ Thursday classā€™ third project ā€¢ Use Audio File Stream Services to pick out audio data from a network stream ā€¢ Enqueue these packets as new AQ buffers ā€¢ Dispose used buffers in callback
  • 65. Parsing web radio NSURLConnection delivers NSData buffers, containing audio and framing info. We pass it to NSData NSData Audio File Services. Packets Packets Packets Packets Packets
  • 66. Parsing web radio NSURLConnection delivers NSData buffers, containing audio and framing info. We pass it to NSData NSData Audio File Services. Packets Packets Packets Packets Packets Packets Packets Audio File Services calls us back with parsed packets of audio data. Packets Packets Packets
  • 67. Parsing web radio NSURLConnection delivers NSData buffers, containing audio and framing info. We pass it to NSData NSData Audio File Services. Packets Packets Packets Packets Packets Packets Packets Audio File Services calls us back with parsed packets of audio data. Packets Packets Packets We create an AudioQueueBuffer Packets Packets with those packets and enqueue it Packets 2 Packets 1 0 for play-out. Packets Packets
  • 68. A complex thing! ā€¢ What if we want to see that data after itā€™s been decoded to PCM and is about to be played? ā€¢ e.g., spectrum analysis, effects, visualizers ā€¢ AudioQueue design is ā€œļ¬re-and-forgetā€
  • 70. AudioQueueProcessingTap ā€¢ Set as a property on the Audio Queue ā€¢ Calls back to your function with decoded (PCM) audio data ā€¢ Three types: pre- or post- effects (that the AQ performs), or siphon. First two can modify the data. ā€¢ Only documentation is in AudioQueue.h
  • 71. Creating an AQ Tap ! ! // create the tap ! ! UInt32 maxFrames = 0; ! ! AudioStreamBasicDescription tapFormat = {0}; ! ! AudioQueueProcessingTapRef tapRef; ! ! CheckError(AudioQueueProcessingTapNew(audioQueue, ! ! ! ! ! ! ! ! ! ! ! tapProc, ! ! ! ! ! ! ! ! ! ! ! (__bridge void *)(player), ! ! ! ! ! ! ! ! ! ! ! kAudioQueueProcessingTap_PreEffects, ! ! ! ! ! ! ! ! ! ! ! &maxFrames, ! ! ! ! ! ! ! ! ! ! ! &tapFormat, ! ! ! ! ! ! ! ! ! ! ! &tapRef), ! ! ! ! "couldn't create AQ tap"); Notice that you receive maxFrames and tapFormat. These do not appear to be settable.
  • 72. AQ Tap Proc void tapProc (void * inClientData, ! ! ! AudioQueueProcessingTapRef inAQTap, ! ! ! UInt32 inNumberFrames, ! ! ! AudioTimeStamp * ioTimeStamp, ! ! ! UInt32 * ioFlags, ! ! ! UInt32 * outNumberFrames, ! ! ! AudioBufferList * ioData) { ! CCFWebRadioPlayer *player = (__bridge CCFWebRadioPlayer*) inClientData; ! UInt32 getSourceFlags = 0; ! UInt32 getSourceFrames = 0; ! AudioQueueProcessingTapGetSourceAudio(inAQTap, ! ! ! ! ! ! ! ! ! ! inNumberFrames, ! ! ! ! ! ! ! ! ! ! ioTimeStamp, ! ! ! ! ! ! ! ! ! ! &getSourceFlags, ! ! ! ! ! ! ! ! ! ! &getSourceFrames, ! ! ! ! ! ! ! ! ! ! ioData); // then do something with ioData // ...
  • 73. So what should we do with the audio?
  • 74. So what should we do with the audio? Letā€™s apply our pitch-shift effect
  • 76. Shouldnā€™t this work? AUEffect AudioUnitRender()
  • 77. AudioUnitRender() ā€¢ Last argument is an AudioBufferList, whose AudioBuffer members have mData pointers ā€¢ If mData != NULL, audio unit does its thing with those samples ā€¢ If mData == NULL, audio data pulls from whatever itā€™s connected to ā€¢ So we just call with AudioBufferList ioData we got from tap callback, right?
  • 78. Psych! ā€¢ AQ tap provides data as signed ints ā€¢ Effect units only work with ļ¬‚oating point ā€¢ We need to do an on-the-spot format conversion
  • 79. invalidnameā€™s convert- and-effect recipe OSStatus converterInputRenderCallback (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList * ioData) { CCFWebRadioPlayer *player = (__bridge CCFWebRadioPlayer*) inRefCon; // read from buffer ioData->mBuffers[0].mData = player.preRenderData; return noErr; } AUConverter AUEffect AUConverter AUGenericOutput Note: red arrows are ļ¬‚oat format, yellow arrows are int
  • 80. How it works ā€¢ AUGraph: AUConverter ā†’ AUEffect ā†’ AUConverter ā†’ AUGenericOutput ā€¢ Top AUConverter is connected to a render callback function
  • 81. The trick! ā€¢ Copy mData pointer to a state variable and NULL it in ioData ā€¢ Call AudioQueueRender() on output unit. The NULL makes it pull from the graph. ā€¢ Top of the graph pulls on render callback, which gives it back the mData we copied off.
  • 82. Yes, really This is the rest of tapProc() ! // copy off the ioData so the graph can read from it // in render callback ! player.preRenderData = ioData->mBuffers[0].mData; ! ioData->mBuffers[0].mData = NULL; ! ! OSStatus renderErr = noErr; ! AudioUnitRenderActionFlags actionFlags = 0; ! renderErr = AudioUnitRender(player.genericOutputUnit, ! ! ! ! ! ! ! ! &actionFlags, ! ! ! ! ! ! ! ! player.renderTimeStamp, ! ! ! ! ! ! ! ! 0, ! ! ! ! ! ! ! ! inNumberFrames, ! ! ! ! ! ! ! ! ioData); ! NSLog (@"AudioUnitRender, renderErr = %ld",renderErr); }
  • 83. Yes, really This is the render callback that supplies data to the intā†’ļ¬‚oat converter OSStatus converterInputRenderCallback (void *inRefCon, ! ! ! ! ! ! ! ! ! AudioUnitRenderActionFlags *ioActionFlags, ! ! ! ! ! ! ! ! ! const AudioTimeStamp *inTimeStamp, ! ! ! ! ! ! ! ! ! UInt32 inBusNumber, ! ! ! ! ! ! ! ! ! UInt32 inNumberFrames, ! ! ! ! ! ! ! ! ! AudioBufferList * ioData) { ! CCFWebRadioPlayer *player = (__bridge CCFWebRadioPlayer*) inRefCon; ! ! // read from buffer ! ioData->mBuffers[0].mData = player.preRenderData; ! return noErr; }
  • 84. Demo: AQ Tap + AUNewTimePitch New in iOS 6!
  • 85.
  • 87. Multi-Route ā€¢ Ordinarily, one input or output is active: earpiece, speaker, headphones, dock- connected device ā€¢ ā€œLast in winsā€ ā€¢ With AV Session ā€œmulti-routeā€ category, you can use several at once ā€¢ WWDC 2012 session 505
  • 88. Utility classes moved again ā€¢ C++ utilities, including the CARingBuffer ā€¢ < Xcode 4.3, installed into /Developer ā€¢ Xcode 4.3-4.4, optional download from developer.apple.com ā€¢ ā‰§ Xcode 4.5, sample code project ā€œCore Audio Utility Classesā€
  • 89. Takeaways ā€¢ Core Audio fundamentals never change ā€¢ New stuff is added as properties, typedefs, enums, etc. ā€¢ Watch the SDK API diffs document to ļ¬nd the new stuff ā€¢ Hope you like header ļ¬les and experimentation
  • 90. Q&A ā€¢ Slides will be posted to slideshare.net/ invalidname ā€¢ Code will be linked from there and my blog ā€¢ Watch CocoaConf PDX glassboard, @invalidname on Twitter/ADN, or [Time code]; blog for announcement ā€¢ Thanks!

Editor's Notes

  1. \n\n
  2. \n\n
  3. \n\n
  4. \n\n
  5. \n\n
  6. \n\n
  7. \n\n
  8. \n\n
  9. \n\n
  10. \n\n
  11. \n\n
  12. \n\n
  13. \n\n
  14. \n\n
  15. \n\n
  16. \n\n
  17. \n\n
  18. \n\n
  19. \n\n
  20. \n\n
  21. \n\n
  22. \n\n
  23. \n\n
  24. \n\n
  25. \n\n
  26. \n\n
  27. \n\n
  28. \n\n
  29. \n\n
  30. \n\n
  31. \n\n
  32. \n\n
  33. \n\n
  34. \n\n
  35. \n\n
  36. \n\n
  37. \n\n
  38. \n\n
  39. \n\n
  40. \n\n
  41. \n\n
  42. \n\n
  43. \n\n
  44. \n\n
  45. \n\n
  46. \n\n
  47. \n\n
  48. \n\n
  49. \n\n
  50. \n\n
  51. \n\n
  52. \n\n
  53. \n\n
  54. \n\n
  55. \n\n
  56. \n\n
  57. \n\n
  58. \n\n
  59. \n\n
  60. \n\n
  61. \n\n
  62. \n\n
  63. \n\n
  64. \n\n
  65. \n\n
  66. \n\n
  67. \n\n
  68. \n\n
  69. \n\n
  70. \n\n
  71. \n\n
  72. \n\n
  73. \n\n
  74. \n\n
  75. \n\n
  76. \n\n
  77. \n\n
  78. \n\n
  79. \n\n
  80. \n\n
  81. \n\n
  82. \n\n
  83. \n\n
  84. \n\n
  85. \n\n
  86. \n\n
  87. \n\n
  88. \n\n
  89. \n\n