I am trying to use the AVFoundationMSB to create a parametric equalizer to filter audio – or even one filter.
I looked through the audio-related code examples provided by MSB but couldn’t find any examples that use the classes to do this (e.g. AVAudioUnitEQFilterParametersMBS).
Has anyone written working code that equalizes audio they are willing to share as an example how to use this class?
Dim eqNode as new AVAudioUnitEQ(1)
eqNode.bands(0).filterType = AVAudioUnitEQFilterParametersMBS.FilterTypeLowPass
eqNode.bands(0).frequency = 20
eqNode.bands(0).byPass = false
audioEngine.attachNode(eqNode)
Thanks. This helped. I can now create and modify different types of filters, listen to their effect on pink noise, and measure them on a real-time analyzer to verify they are working as expected.
The one exception is the Parametric filter which is nothing more than a wide-band volume control affecting the entire spectrum when you would expect a narrow peak or dip (e,g, freq = 1000, BW = 500, gain = -5 produces the black curve below when it should be a narrow dip centered at 1kHz)
This happens with the following code: Any ideas why it’s not working as expected>
Thanks
EQnode.reset
dim bands() as AVAudioUnitEQFilterParametersMBS = EQNode.Bands
Dim Freq as Double
Dim BW as Double
Dim Gain as Double
Freq = Textfield1.text.ToDouble
BW = TextField2.Text.ToDouble
Gain = TextField3.Text.ToDouble