AKEqualizerFilter 没有效果

AKEqualizerFilter has no effect

我尝试使用 AKEqualizerFilters 为 iOS 制作均衡器,但它们似乎对声音根本没有影响。正常的声音出来了,但是滤波器根本不影响它。我正在使用带有 objective-c 的 AudioKit v4。播放器最初设置为无声,用户必须先 select 一个文件才能加载。我按照 AudioKit Playground 的说明完成了这一步 https://audiokit.io/playgrounds/Effects/Graphic%20Equalizer/

同样值得注意的是,我也尝试使用 HighShelf、LowShelf 和峰值参数均衡器进行此操作,但对声音也没有影响。

@property(nonatomic, retain) AKPlayer* player;
@property(nonatomic, retain) AKEqualizerFilter* lowFilter;
@property(nonatomic, retain) AKEqualizerFilter* midFilter;
@property(nonatomic, retain) AKEqualizerFilter* highFilter;
_player = [[AKPlayer alloc] init];
// Setting the filters here initially has no effect on the sound
_lowFilter = [[AKEqualizerFilter alloc] init:_player centerFrequency:50 bandwidth:100 gain:1.0];
_midFilter = [[AKEqualizerFilter alloc] init:_lowFilter centerFrequency:350 bandwidth:300 gain:1.0];
_highFilter = [[AKEqualizerFilter alloc] init:_midFilter centerFrequency:5000 bandwidth:1000 gain:1.0];

AKManager.output = _highFilter;
// these also have no effect
[_lowFilter setGain:0.0];
[_midFilter setGain:5.0];
[_highFilter setGain:10.0];

想通了。原来我试图播放的文件甚至没有通过 AKPlayer,它正在使用我们用来播放云端歌曲的另一个系统。

将代码片段留在此处以备日后参考