ios - Export audio file after adding an effect -
i have audio file want process using effects (like pitch effect) , write final result file. before process file , save disc let user play pitch effect , listen changes in real time. this how real time stuff: let audiosession = avaudiosession.sharedinstance() audiosession.setcategory(avaudiosessioncategoryplayback, error: nil) audiosession.setactive(true, error: nil) audioengine = avaudioengine() audiofile = avaudiofile(forreading: audiourl!, error: nil) audioplayernode = avaudioplayernode() audioengine.attachnode(audioplayernode) changepitcheffect = avaudiounittimepitch() changepitcheffect.pitch = 1.0 // default audioengine.attachnode(changepitcheffect) audioengine.connect(audioplayernode, to: changepitcheffect, format: nil) audioengine.connect(changepitcheffect, to: audioengine.outputnode, format: nil) let framecapacity = uint32(audiofile.length) let buffer = avaudiopcmbuffer(pcmformat: audiofile.processingformat,...