ios - how to set scope and element when using audio unit -


i developing karaoke software.and intend mix audio using audiounit,but don't know how set scope , element?for example:

uint32 buscount = 2; osstatus result = audiounitsetproperty (     mixerunit,     kaudiounitproperty_elementcount     kaudiounitscope_input,     0,     &buscount,     sizeof (buscount ); 

why scope 'kaudiounitscope_input' , element '0',what's meaning of this?

this illustration apple docs make pretty clear:

a scope programmatic context within audio unit. although name global scope might suggest otherwise, these contexts never nested. specify scope targeting using constant audio unit scopes enumeration.

the 0 refers "output bus".

an element programmatic context nested within audio unit scope. when element part of input or output scope, analogous signal bus in physical audio device—and reason called bus. these 2 terms—element , bus—refer same thing in audio unit programming. document uses “bus” when emphasizing signal flow , uses “element” when emphasizing specific functional aspect of audio unit, such input , output elements of i/o unit (see “essential characteristics of i/o units”).

it's best use defines give bus values semantics:

// put in header file #define koutputbus 0 #define kinputbus 1 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -