Install ofxAudioUnit on iOS

Hi all. I’m very much a beginner here, I’m trying to get the ofxAudioUnit examples to run on iOS (0.8.0), within Xcode 4.6.3.

I’ve added the AudioUnit and CoreAudioKit frameworks as described here, but when I build I get the error:

AudioToolbox/AudioUnitUtilities.h, file not found  

I have since included the AudioToolbox framework in the same way, but still the same error. I’ve tried including these frameworks both for iOS, and for Desktop, but still get the error, despite the file being visible in the navigator window.

I’ve noticed the file does NOT actually exist in the AudioToolkit framework for iOS, could it be that somehow the iOS framework is included by default, overriding any additional frameworks that I add?

Has anyone out there had any success getting ofxAudioUnits to work on iOS?

Many thanks

+1 on this one! would be great to be able to use ofxAudioUnit on iOS, i’m also getting the same compile issues as amigolargo…

Anyone has made progress with this?

Yes I’ve started an iOS branch here. It should compile and run, but it’s not finished yet. I think the missing link at the moment is just that the AVAudioSession needs to be initialized.

Also, for the record, it’s much easier to get my attention directly by taking this directly to Github :smile: There’s an issue open here that you can chime in on if you like.

As-is, the port should let you do output, but input and DSP won’t work yet. The input should be relatively straightforward if anyone would like to take on the task of filling in configureInputDevice() here (there’s code that does roughly the same thing in OF already, here).

Thanks Adam, that’s great news! I’ll make sure to talk to raise any other issues on github directly :slight_smile:

I’ve succesfully created a new empty project with ofxAudioUnit as an addon, the code compiles and runs but no sound at all, no matter what objects and connections I try.
BTW, I’m using OF 8.1 for iOS, XCode 5.1.1 and iPhone 5.

At the moment i’m trying the simplest of things:


#pragma once

#include "ofMain.h"
#include "ofxiOS.h"
#include "ofxiOSExtras.h"

#include "ofxAudioUnit.h"

class ofApp : public ofxiOSApp{
        void setup();
        void update();
        void draw();
        void exit();
        void touchDown(ofTouchEventArgs & touch);
        void touchMoved(ofTouchEventArgs & touch);
        void touchUp(ofTouchEventArgs & touch);
        void touchDoubleTap(ofTouchEventArgs & touch);
        void touchCancelled(ofTouchEventArgs & touch);

        void lostFocus();
        void gotFocus();
        void gotMemoryWarning();
        void deviceOrientationChanged(int newOrientation);

        ofxAudioUnitFilePlayer filePlayer;
        ofxAudioUnitOutput     output;


#include "ofApp.h"

void ofApp::setup(){


void ofApp::update(){


void ofApp::draw(){

void ofApp::exit(){


void ofApp::touchDown(ofTouchEventArgs & touch){


void ofApp::touchMoved(ofTouchEventArgs & touch){


void ofApp::touchUp(ofTouchEventArgs & touch){


void ofApp::touchDoubleTap(ofTouchEventArgs & touch){


void ofApp::touchCancelled(ofTouchEventArgs & touch){

void ofApp::lostFocus(){


void ofApp::gotFocus(){


void ofApp::gotMemoryWarning(){


void ofApp::deviceOrientationChanged(int newOrientation){


Any idea of what might be going on?


Yepp :smile:

You can basically just google that one (e.g. ). The trick is that ofxAudioUnit may have to coordinate its AVAudioSession with ofSoundStream, so it’s not totally straightforward to add the functionality in the addon yet.

You might also be able to get away with just doing ofSoundStreamSetup(...) before the starting the output unit, but that might do weird things (since there’ll be two things trying to own the output from the same app).

Thanks Adam! I ended up adding this to the beginning

// Setup audio session
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

Managed to succesfully “port” your parameters-example!!

Good to hear that’s all it took :slight_smile:

I’ll be stuck for a few days but maybe I can take a stab at a more complete port in a week or two.

Great Adam :slight_smile: Let me know if there is anything i can do to help.



I have similar problems installing ofxAudioUnit on iOS and I don’t know how to solve it.
@mrgasparov could you send me your iOS project to look inside and see the differences between your project and mine?
Thank you so much!


@damia are you using the ios branch?

What problems are you running into specifically?

Hi @admsyn, I’m working with @damia and yes, we are using the ios branch addon. When we try to import your parameters-example to iOS we get a bunch of differents erros so we thought it must be because we didn’t setup the audio session like @mrgasparov said, so when we tried to did it like him we must wrote > #import <AVFoundation/AVFoundation.h> in the .h file, if not, we got errors. Even so we still have a lot of problems, here you can see an image:


What should we do?.

PS: We tried the example that @mrgasparov posted here, and we get the same erros. Maybe it could be something connected with the frameworks (CoreAudio, AudioToolbox)?.

Thank you so much.

PS2: If you need more screenshots tell me.

It looks like you’re just missing the CoreMIDI framework (hence all the MIDI linker errors)

mmm … silly me! You’re right! thank you @admsyn, I could port your parameters-example (in fact that the “tap” part (ofxAudioUnitTap (xCode says that doesn’t exist, must be ofxAudioUnit) and filePlayer.showUI(), xCode says that anything named showUI inside filePlayer exist.