How can i set the bass, or other kind of Equalizer programatically for my iphone app? Are there ready frameworks or methods available?? Kindly please provide a reference..
4 Answers
If you build your audio playback as an AudioUnit graph, you should be able to use the built-in iPod EQ AudioUnit, with presets like those in the iPod application. Have a look at this example which will hopefully help you understand how to do this.
As you're reading the code, make sure you understand that Audio Units are nodes in a graph, where the audio signal flows through the graph by means of callbacks, and that each node can modify the signal on it's way towards the output node (essentially the speaker.) So what you do is you load your file into memory, and you then feed the PCM (sound sample) data to the audio unit in a callback that you have specified. When the buffer is empty, the callback will be invoked and you can fill it up.
The linked example sets up a mixer node, an output node and the equalizer node, connects them together, and starts playing a number of sound files after having loaded them into memory.
If the iPod EQ AU doesn't do what you want it to do, you can build your own AudioUnit and replace it later, but that requires some DSP knowledge. You may also be able to find some open-source equalizers out there that have been implemented as Audio Units (which is a common format on the Mac platform for effects used in music production tools for example.)

- 4,041
- 1
- 17
- 19
-
I recommend you to take a look at NVDSP: https://github.com/bartolsthoorn/NVDSP It allows you to do biquad filters on raw samples without DSP knowledge. (Novocaine is not required, but recommended) – sougonde Oct 06 '12 at 14:44
-
Hi @richardolsson,I have tried this way and it worked for local songs,but not working for streaming songs,My question is cant we use same way to get at least iPod EQ effect? – Infaz Feb 09 '16 at 10:53
No there is no way you can get a direct settings/Equalizer Settings in AVAudio Player.
It is an framework provided by Apple, so all you can access is all you get in class reference.
So I would like to go through Class Reference and there is no point where it says you can access the Equalizer settings.
Here is the link for it.
Hope this helps.
EDIT-1:
If you are wanting to use some other library which gives you extensive access to settings and which can even give sounds effects that even a DJ would be pleased by then you can use
This is a paid library but it is worth buying if you really want good and effective sound effects and access to all the settings.

- 19,381
- 28
- 133
- 216
-
Thanks Parth Bhatt, Can you help me for sample code for "Obtain data you can use for playback-level metering" as mentioned in link.. or sample code to use "AVSampleRateKey" or "AVEncoderBitRateKey" so that i can analyze the audio rate?? – DShah Aug 24 '11 at 07:01
-
1@DShah: All these methods are for using audio level metering. So it obtains limited settings. Here are those methods you can refer it to in the link : `meteringEnabled property` `– averagePowerForChannel:` `– peakPowerForChannel:` `– updateMeters`. – Parth Bhatt Aug 24 '11 at 07:11
If you are using audio queues or remoteIO audio units for audio, you can write and use your own DSP filters to process and equalize your audio sample arrays or buffers. Cascaded or parallel banks of IIR filters are one possibility. FFT overlap add/save filtering is another possible DSP technique that will allow a custom equalization curve.

- 70,107
- 14
- 90
- 153
-
That's because it is a "complex" subject. Either you learn a lot of DSP (math and coding), or hire an expert, or find a library somewhere (possibly under commercial license). There is no built-in public API. – hotpaw2 Aug 24 '11 at 17:21
No there is no framework available for that. I think the reason behind not providing such framework is that equalizing and setting the mode like bass, classic, etc. is not a generic functionality that all application using audio services may need. Those who require that need to implement them.

- 843
- 2
- 11
- 33