objective c - How to set pan in IOS Audio Unit Framework -


hello stack overflow users,

i want change pan position using uislided in ios application.

i upgrading whole app using audiostreamer of matt gallagher

to change pan value in in audiostreamer used below code.

audioqueueref audioqueue; // defined in audiostreamer.h file

    - (void)changepan:(float)newpan {     osstatus panerr = audioqueuesetparameter( audioqueue, kaudioqueueparam_pan, newpan);     nslog(@" setting pan: %ld", panerr);     if( panerr )         nslog(@"error setting pan: %ld", panerr); } 

i replacing audiostreamer streamingkit use audiounit

if make thing done using streamingkit or audiounit appreciate that.

p.s let me know if needs more info.

thanks

using audiounit api, can set kmultichannelmixerparam_pan property of audio mixer unit set stereo pan:

audiounitparametervalue panvalue = 0.9; // panned dead-right. possible values between -1 , 1 int result = audiounitsetparameter(mixerunit, kmultichannelmixerparam_pan, kaudiounitscope_input, 0, panvalue, 0); if (result == 0) {    nslog("success"); } 

you may need retrieve internal mixerunit instance variable inside stkaudioplayer. can try [audioplayer valueforkey:@"_mixerunit"] or implement getter inside streamingkit's files.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -