• AVAudioUnitEQ для AVPlayer?

    подключить можно через 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 = 2000.0

    //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)
    Ответ написан
    Комментировать