Add iPod Equalizer Effect with AVPlayer

We are developing a music application using AVPlayer, which is in its final stages. Everything was on the way until we started working on iPod Equalizer , applying effects to the current song. We can get a list of built-in equalizers, when we use AudioUnitProperty , we do not see any effects in the songs.

Your valuable response will be useful to us.

+6
source share
2 answers

You can certainly perform various equalizer effects using AUGraph and AudioUnits in iOS.

Basically, you should insert an effect between the source and the output of your audio. You can use things like a multi-channel mixer to have some control or other more complex audio devices in AUGraph to get much more control over the audio. Using AudioUnits, if you need to, you can even get every sample of audio in the buffer. This will require you to re-encode some of your sound processing, but it will certainly allow you to apply equalizer effects.

You can use the iPod effects module, which is exactly the same as iOS, to apply these effects when playing music. This will give you the closest match for effect sounds since it is exactly the same AudioUnit .

From Apple:

iPod EQ Audio Unit Description (scroll down page)

Type definition for subtype of audio unit

The iPod EQ unit provides a set of predefined tone equalization curves as factory presets. Get an array of available equalizer settings by looking at the properties of the kAudioUnitProperty_FactoryPresets audio device. Then you can apply the parameter using it as the value of the kAudioUnitProperty_PresentPreset property.

You must insert this device between your sound source (be it a file, microphone input, etc.) and your audio output (speakers, headphones, etc.). You can then apply any of the effects of iPod EQ to your audio.

Here are the attributes to use when specifying the iPod EQ module:

kAudioUnitType_Effect

kAudioUnitSubType_AUiPodEQ

kAudioUnitManufacturer_Apple

Also, be sure to check out Apple Audio Placement Guide . This page contains links to most of the other relevant documentation that you want to use.

+4
source

Using MTAudioProcessingTap + AUGraph + AudioUnit can do this, the official AudioTapProcessor demo shows you how to use MTAudioProcessingTap to process audio data and then combine with AVPlayer on it handle the callback, replace it with AudioUnit using AUGraph + AudioUnit

+2
source

Source: https://habr.com/ru/post/946373/


All Articles