Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Custom Audio Units on the iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom Audio Units on the iPhone




On Nov 24, 2008, at 6:59 AM, Thomas Zoechling wrote:

I am trying to use Audio Units and AUGraph on the iPhone (SDK 2.2)
I want to build a simple AUGraph from 5 audio units that render a sine wave.
The sine wave units are connected to a mixer that is hooked to a default output device node.
My first attempt was, to use a default Audio Unit and provide a render callback to create the sine wave.
(Similar to /Developer/Examples/CoreAudio/SimpleSDK/DefaultOutputUnit)


This works for one single unit, playing on the default output device. (after some small changes, the DefaultOutputUnit sample also works on the iPhone)
As I need several units that generate output at the same time, I wanted to use AUGraph.
To my understanding, the AUGraph API wants me to connect my sine- wave AUs to the mixer and the mixer to an output node.
Therefore the sine-wave AUs should have the component type kAudioUnitType_Generator. (I think this would be the right component type for the task I
am trying to accomplish)

So, all is good until here:
But there seems to be no default generator unit available on the phone and so I cannot provide my render callback.

iPhone doesn't currently provide an ability for you to register an audio unit so that AUGraph could find it. On the desktop, where you can register your AUGenerator audio unit, then the approach is fine.



So, for iPhone what you would do is:

Create a graph that is a mixer unit connected to an output unit. Each input to the mixer is going to be a render callback. So, in this instance it is very similar to the default output example, except that now you have many potential inputs and the ability to mix them, control their volume, their pan/location (depending on which mixer you use).

You can create a custom audio unit on the phone, but without the registration service, you can't have to registered so your calls to AUGraph would find it. So, if you did make a custom audio unit, then you'd have to basically manage it yourself (from your render call back on the mixer, call your custom audio unit's AudioUnitRender call) - its a less than ideal solution at this point I think.

Bill

Do I have to implement a full Generator Audio Unit?
The iPhone Application Programming Guide states that this should be possible (http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AudioandVideoTechnologies/chapter_9_section_2.html#/ /apple_ref/doc/uid/TP40007072-CH19-SW4)
but I could not find any further details.
Has someone implemented a custom AU on the phone?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Custom Audio Units on the iPhone (From: Thomas Zoechling <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.