GrayFox
GrayFox

Reputation: 121

iOS: AudioUnit of current AVAudioPlayer

I am working on an app which uses AVAudioPlayer to play a audio file.Thats working fine, but now i want to add Equalizer presets.I have got all presets value from this code

AudioUnitGetProperty(AudioUnit instance, kAudioUnitProperty_FactoryPresets, kAudioUnitScope_Global, 0, &mEQPresetsArray, &size);

I can change Audio unit property with the following line

AUPreset *aPreset = (AUPreset*)CFArrayGetValueAtIndex(EQPresetsArray, 7);
AudioUnitSetProperty(AudioUnit instance, kAudioUnitProperty_PresentPreset, kAudioUnitScope_Global, 0, aPreset, sizeof(AUPreset));

But problem is i am not able to get AudioUnit of current player/AVAudioPlayer instance.

Is there a simple solution for this task?

Thanks in advance!!!!

Upvotes: 4

Views: 1419

Answers (1)

soh-la
soh-la

Reputation: 360

You could take one step back and use AVPlayer, then add a MTAudioProcessingTap.Example Code Here

Upvotes: 2

Related Questions