iOS Audio Units : When is usage of AUGraph's necessary? -
iOS Audio Units : When is usage of AUGraph's necessary? -
i'm totally new ios programing (i'm more android guy..) , have build application dealing sound dsp. (i know it's not easiest way approach ios dev ;) )
the app needs able take inputs both :
1- built-in microphone 2- ipod library
then filters may applied input sound , resulting outputed :
1- speaker 2- record file
my question next : augraph necessary in order able illustration apply multiple filters input or can these different effects applied processing samples different render callbacks ?
if go augraph need : 1 sound unit each input, 1 sound unit output , 1 sound input each effect/filter ?
and if don't may have 1 sound unit , reconfigure in order select source/destination ?
many answers ! i'm getting lost stuff...
you may indeed utilize render callbacks if wished built in sound units great (and there things coming can't here yet under nda etc., i've said much, if have access ios 5 sdk recommend have look).
you can implement behavior wish without using augraph
, recommended takes care of lot of things under hood , saves time , effort.
from audio unit hosting guide (ios developer library):
the augraph
type adds thread safety sound unit story: enables reconfigure processing chain on fly. example, safely insert equalizer, or swap in different render callback function mixer input, while sound playing. in fact, augraph
type provides api in ios performing sort of dynamic reconfiguration in sound app.
choosing design pattern (ios developer library) goes detail on how take how implement sound unit environment. setting sound session, graph , configuring/adding units, writing callbacks.
as sound units want in graph, in add-on stated, want have multichannel mixer unit (see using specific sound units (ios developer library)) mix 2 sound inputs , hook mixer output unit.
direct connectionalternatively, if straight without using augraph, next code sample hook sound units yourself. (from constructing sound unit apps (ios developer library))
you can, alternatively, found , break connections between sound units straight using sound unit property mechanism. so, utilize audiounitsetproperty
function along kaudiounitproperty_makeconnection
property, shown in listing 2-6. approach requires define audiounitconnection construction each connection serve property value.
/*listing 2-6*/ audiounitelement mixerunitoutputbus = 0; audiounitelement iounitoutputelement = 0; audiounitconnection mixerouttoiounitin; mixerouttoiounitin.sourceaudiounit = mixerunitinstance; mixerouttoiounitin.sourceoutputnumber = mixerunitoutputbus; mixerouttoiounitin.destinputnumber = iounitoutputelement; audiounitsetproperty ( iounitinstance, // connection destination kaudiounitproperty_makeconnection, // property key kaudiounitscope_input, // destination scope iounitoutputelement, // destination element &mixerouttoiounitin, // connection definition sizeof (mixerouttoiounitin) );
ios core-audio ipod audiounit
Comments
Post a Comment