1

I assume that I will need Audio Units to do this. AFAIK there is a EQ Audio Unit on iOS. Is there a framework which can play a music file and apply an EQ to it in realtime?

openfrog
  • 40,201
  • 65
  • 225
  • 373

2 Answers2

2

I do not know if there is a framework or not. But you can build a simple AUGraph of audio units. You need three units:

  • kAudioUnitSubType_RemoteIO -- for output
  • kAudioUnitSubType_NBandEQ -- EQ
  • kAudioUnitSubType_AudioFilePlayer -- to play files

Connect them like this:

player -> EQ -> RemoteIO

Please, note that kAudioUnitSubType_AudioFilePlayer can play only files in native Float32, deinterleaved format. If you want play compressed files or files in other format you need to convert them.

  • Is the NBandEQ a parametric or a linear phase EQ? and what are it's limitations? – openfrog Nov 20 '12 at 20:27
  • NBandEQ has parametr named "kAUNBandEQParam_FilterType" with some of values "kAUNBandEQFilterType_Parametric". Also, iOS have "kAudioUnitSubType_ParametricEQ" Audio Unit. You can read about it here (http://developer.apple.com/library/ios/#documentation/AudioUnit/Reference/AudioUnitParametersReference/Reference/reference.html) under the "Parametric EQ Unit Parameters" and "Multitype EQ (NBandEQ) Unit Parameters" sections. – Aliaksandr Andrashuk Nov 20 '12 at 21:01
1

Yes, it is definitely possible to do, and not that difficult. You can use audio units, but it's much easier not to. There is a great framework called novocaine that you can use which gives you a block-based callback where you can implement your DSP algorithm directly.

You should still use AudioUnits to do the processing if you want to have complete control over the audio stack. In my experience, this is rarely necessary and novocaine is usually much more painless (hence the name).

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160