我想要实现的是通过从UISlider
示例 1(正常状态)发送值以编程方式更改截止参数:
Float32 highPassFilterCutoff = 4000.0;
CheckError(AudioUnitSetParameter(_auHighPassFilter,
kHipassParam_CutoffFrequency,
kAudioUnitScope_Global,
0,
highPassFilterCutoff,
0),
"Coulnd't set kHipassParam_CutoffFrequency ");
我想要的是:
NSLog(@"cutOffSlider.value in effect %f",cutOffslider.value );
Float32 highPassFilterCutoff = cutOffslider.value;
CheckError(AudioUnitSetParameter(_auHighPassFilter,
kHipassParam_CutoffFrequency,
kAudioUnitScope_Global,
0,
highPassFilterCutoff,
0),
"Coulnd't set kHipassParam_CutoffFrequency ");
我是这样尝试的...
-(IBAction)cutOffslider:(id)sender {
[cutOffslider setMinimumValue:0.0];
[cutOffslider setMaximumValue:6000.0];
NSLog(@"SliderValue ... %d",(int)sender);
}
调试控制台上的输出
PlayBasic[567:c07] cutOffSlider.value in effect 0.500000
你怎么能看到我可以从滑块获得浮点值,但是当我在模拟器上通过滑块增加或减少值时,效果不会改变截止参数。在运行时更改参数的任何想法?