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
Post a Comment