ios – How to create a simple EQ like AVAudioUnitEQ in AudioKit?


I’m attempting to transition my audio project to utilize AudioKit. In my current setup, I employ a standard Apple node for equalization. Here’s a snippet to provide context:

var engine = AVAudioEngine()
var eqNode = AVAudioUnitEQ()

engine.attach(eqNode)

func initEqualizer() {
    eqNode = AVAudioUnitEQ(numberOfBands: frequencies.count)
    eqNode.globalGain = 0
    for i in 0..<frequencies.count {
        eqNode.bands[i].frequency = Float(frequencies[i])
        eqNode.bands[i].gain = 0
        eqNode.bands[i].bypass = false
        eqNode.bands[i].filterType = .parametric
    }
}

eqNode.globalGain = eqSettings.generalGain
for i in 0..<frequencies.count {
    eqNode.bands[i].gain = values[i]
}


I had assumed that integrating ParametricEQ would be straightforward, but I’ve encountered challenges:

  • The ParametricEQ appears to utilize different parameters and lacks a globalGain feature, which is essential for my setup.
  • Despite reviewing AudioKit’s cookbook examples, I haven’t found a similar straightforward example of a simple equalizer.

It seems like I may need to develop a custom Equalizer class in AudioKit to replicate the functionality of my AVAudioUnitEQ. Am I on the right track, or is there something I might be overlooking?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img