@
@
@dancoder2019-07-31 14:29:54
iOS
@dancoder, 2019-07-31 14:29:54

AVAudioUnitEQ for AVPlayer?

Good afternoon everyone! I am streaming audio using AVPlayer. Question such - as it is possible to fasten AVAudioUnitEQ to it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasili Krasnouski, 2020-09-23
@FanLee

you can connect via AVAudioEngine
EQNode = AVAudioUnitEQ(numberOfBands: 2)
EQNode.globalGain = 1
audioEngine.attach(EQNode)
let filterParams = EQNode.bands[0] as AVAudioUnitEQFilterParameters
filterParams.filterType = .resonantLowShelf
// 20hz to nyquist
filterParams.frequency = 20hz
//The value range of values ​​is 0.05 to 5.0 octaves
filterParams.bandwidth = 0.05
//5.0 filterParams.bypass = false
// in db -96 db through 24 d
filterParams.gain = 1.0
let filterParams2 = EQNode.bands[1] as AVAudioUnitEQFilterParameters
filterParams2.filterType = .lowPass
// 20hz to nyquist
filterParams2.frequency = 2000.0
//The value range of values ​​is 0.05 to 5.0 octaves
filterParams2.bandwidth = 5.0
filterParams2.bypass = false
// in db -96 db through 24 d
filterParams2. gain = 1.0
audioEngine.connect(EQNode, to: audioEngine.mainMixerNode, format: buffer!.format)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question