简体   繁体   English

AKEqualizerFilter 没有效果

[英]AKEqualizerFilter has no effect

I've tried to use AKEqualizerFilters to make an equalizer for iOS, but it seems like they have no effect on the sound at all.我尝试使用 AKEqualizerFilters 为 iOS 制作均衡器,但似乎它们对声音根本没有影响。 The normal sound comes out, but the filters don't affect it at all.正常的声音出来了,但过滤器根本不影响它。 I'm using v4 of AudioKit with objective-c.我正在使用带有 objective-c 的 AudioKit v4。 Player is set with no sound at first, the user has to select a file to load first.播放器最初设置为无声音,用户必须先加载 select 文件。 I followed the instructions from the AudioKit Playground to get this far https://audiokit.io/playgrounds/Effects/Graphic%20Equalizer/我按照 AudioKit Playground 的说明走到了这一步 https://audiokit.io/playgrounds/Effects/Graphic%20Equalizer/

Also worth noting, that I tried this with HighShelf, LowShelf and Peaking Parametric Equalizers as well, but also no effect on the sound.另外值得注意的是,我也尝试使用 HighShelf、LowShelf 和 Peaking Parametric Equalizers,但对声音也没有影响。

@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];

Figured it out.弄清楚了。 Turns out the file I was trying to play wasn't even going through AKPlayer, it was using another system we're using to play songs from the cloud.原来我试图播放的文件甚至没有通过 AKPlayer,它使用的是我们用来播放云端歌曲的另一个系统。

Leaving the code snippet here in case anyone wants to use it for future reference将代码片段留在这里,以防有人想使用它以供将来参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM