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.
Effortless creation of live audio content with objects, blocks, or Audio Units and looping audio file players.
Automatic mixing of multiple audio signals with per-channel volume and pan controls.
Built-in support for audio filtering and effects, with support for Audio Units, blocks or object filters.
Rich audio input support with sophisticated multi-channel support.
Deep Audiobus inter-app audio system support.
Sophisticated system output recording and monitoring for in-app session recording or analysis.
Arbitrary audio format support: Interleaved, non-interleaved, mono, stereo, 16-bit, floating-point - whatever you need.
Built-in audio file reading and writing, with support for all Core Audio-supported formats.
Support for pinpoint-accurate timestamp based timing and alarm mechanisms.
Very light, efficient C engine, designed from the ground up for speed.
Fast, lock-free synchronisation between main and audio threads.
High-quality documentation with sample code and a
developer forum.// 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];
// 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]];
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];
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]; }