Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!!!!

like image 904
GrayFox Avatar asked Sep 16 '25 15:09

GrayFox


1 Answers

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

like image 70
soh-la Avatar answered Sep 18 '25 10:09

soh-la