Newsletter

×

Stay in the loop by signing up to our newsletter here.

The Amazing Audio Engine.

Core Audio. Cordially.

The Amazing Audio Engine is a sophisticated framework for iOS audio applications, built so you don't have to.

It is designed to be very easy to work with, and handles all of the intricacies of iOS audio on your behalf.

Built upon the efficient and low-latency Core Audio Remote IO system, and written by one of the pioneers of iOS audio development and developer of Audiobus Michael Tyson, The Amazing Audio Engine lets you get to work on making your app great instead of reinventing the wheel.


Examples

Add a channel with a block implementation

// Create an instance of the audio controller
self.audioController = [[[AEAudioController alloc]
                         initWithAudioDescription:
                           [AEAudioController nonInterleaved16BitStereoAudioDescription]] 
                         autorelease];
 
AEBlockChannel *channel = [AEBlockChannel channelWithBlock:
  ^(const AudioTimeStamp  *time,
    UInt32           frames,
    AudioBufferList *audio) {
 
    // Generate audio here
 
}];
 
// Add and start playing channel
[_audioController addChannels:[NSArray arrayWithObjects:channel, nil]];
 
// Start the audio engine.
[_audioController start:NULL];

Add two looping audio file tracks

// Initialise tracks
AEAudioFilePlayer *track1 = 
  [AEAudioFilePlayer audioFilePlayerWithURL:
    [[NSBundle mainBundle] URLForResource:@"Track 1" withExtension:@"m4a"]
                            audioController:_audioController
                                      error:NULL];
AEAudioFilePlayer *track2 = 
  [AEAudioFilePlayer audioFilePlayerWithURL:
    [[NSBundle mainBundle] URLForResource:@"Track 2" withExtension:@"m4a"]
                            audioController:_audioController
                                      error:NULL]; 
 
// Set to loop mode
track1.loop = YES;
track2.loop = YES;
 
// Add channels
[_audioController addChannels:[NSArray arrayWithObjects:track1, track2, nil]];

Create a filter and add it to a track

AEBlockFilter *filter = [AEBlockFilter filterWithBlock:
    ^(AEAudioControllerFilterProducer producer,
      void                     *producerToken,
      const AudioTimeStamp     *time,
      UInt32                    frames,
      AudioBufferList          *audio) {
 
      // Pull audio
      OSStatus status = producer(producerToken, audio, &frames);
      if ( status != noErr ) return;
 
      // Now filter audio in 'audio'
}];
 
[_audioController addFilter:filter toChannel:track1];

Create an Audio Unit and use it to filter your app's audio

NSError *error = NULL;
AEAudioUnitFilter *reverb
     = [[[AEAudioUnitFilter alloc]
        initWithComponentDescription:AEAudioComponentDescriptionMake(kAudioUnitManufacturer_Apple, 
                                                                     kAudioUnitType_Effect, 
                                                                     kAudioUnitSubType_Reverb2)
                     audioController:_audioController
                               error:&error] autorelease];
 
if ( reverb ) {
  // Assign a parameter value
  AudioUnitSetParameter(reverb.audioUnit,
                        kAudioUnitScope_Global,
                        0, 
                        kReverb2Param_DryWetMix, 
                        100.f, 
                        0);
 
  // Begin filtering
  [_audioController addFilter:reverb];
}