简体   繁体   中英

AVAudioEngine apply audio effects

I am trying to make audio processing application. Is there a way to apply audio effects to audio file using AVAudioEngine?

Yes, you sure can, You can use:

  • AVAudioPlayerNode
  • AVAudioUnitDistortion (or any other effect unit)
  • engine.outputNode (speaker)

The general connection of the graph looks like:

func connectNodes()
{
    engine.connect(unitfilePlayer, to:unitdistortionUnit, format:unitfilePlayerformat)
    engine.connect(unitdistortionUnit, to:unitspeaker, format:engine.mainMixerNode.outputFormat(forBus: 0))
}

So the graph looks like:

图表示例

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM