How to use an Audio Unit on the iPhone

11,372

Solution 1

There are some very good resources here (http://michael.tyson.id.au/2008/11/04/using-remoteio-audio-unit/) for using the RemoteIO Audio Unit. In my experience working with Audio Units on the iPhone, I've found that I can implement a transformation manually in the callback function. In doing so, you might find that solves you problem.

Solution 2

Regarding changing pitch on the iPhone, OpenAL is the way to go. Check out the SoundManager class available from www.71squared.com for a great example of an OpenAL sound engine that supports pitch.

Share:
11,372
Bob Black
Author by

Bob Black

I'm a software developer in the Atlanta area with over a decade of experience. I'm currently employed by one of the 40 largest law firms in North America. Follow me on twitter: @CodeToaster.

Updated on June 16, 2022

Comments

  • Bob Black
    Bob Black almost 2 years

    I'm looking for a way to change the pitch of recorded audio as it is saved to disk, or played back (in real time). I understand Audio Units can be used for this. The iPhone offers limited support for Audio Units (for example it's not possible to create/use custom audio units, as far as I can tell), but several out-of-the-box audio units are available, one of which is AUPitch.

    How exactly would I use an audio unit (specifically AUPitch)? Do you hook it into an audio queue somehow? Is it possible to chain audio units together (for example, to simultaneously add an echo effect and a change in pitch)?

    EDIT: After inspecting the iPhone SDK headers (I think AudioUnit.h, I'm not in front of a Mac at the moment), I noticed that AUPitch is commented out. So it doesn't look like AUPitch is available on the iPhone after all. weep weep

    Apple seems to have better organized their iPhone SDK documentation at developer.apple.com of late - now its more difficult to find references to AUPitch, etc.

    That said, I'm still interested in quality answers on using Audio Units (in general) on the iPhone.

  • Hyder
    Hyder over 7 years
    Keep in mind OpenAL only supports real-time audio pitch change, means you can't save the altered audio