Category Archives: AVFoundation

Multi-timbral AVAudioUnitMIDIInstrument

Swift Language

Multi-timbral AVAudioUnitMIDIInstrument in Swift Table of Contents Introduction Core Audio Unit AVFoundation Unit Summary Resources Introduction Table of Contents There is one sublcass of AVAudioUnitMIDIInstrument provided by Apple – the AVAudioUnitSampler. The only problem is that it is mono-timbral; it cannot play more than one timbre at a time. To create a new AVAudioUnit, we […]

Also posted in Core Audio, Swift | Tagged , | 29 Responses

The Great AVAudioUnitSampler workout

Swift Language

The Great AVAudioUnitSampler workout How to use the AVAudioUnitSampler using Swift. This was written for Swift 3. The Github repo has been updated for Swift 4. I’ve not updated the examples in the post yet. Table of Contents Introduction Sampler from SoundFont Sampler from aupreset Sampler from sound files Multiple voices Summary Resources Introduction Table […]

Also posted in Swift | Tagged , | 11 Responses

iOS: trimming audio files with Swift

Swift Language

iOS: trimming audio files I’ve written about how to record audio on iOS using Swift. But, how do you trim the recording? Introduction Summary Resources Introduction Table of Contents One way to trim an audio file is to use AVFoundation’s AVAssetExportSession. You create an export session instance, set its parameters, and then tell it to […]

Also posted in Computer Music, Core Audio, Swift | Tagged , | 13 Responses

AVFoundation audio recording with Swift

Swift Language

Swift AVFoundation Recorder Use AVFoundation to create an audio recording. Introduction Creating a Recorder Recorder Delegate Recording Summary Resources Introduction AVFoundation makes audio recording a lot simpler than recording using Core Audio. Essentially, you simply configure and create an AVAudioRecorder instance, and tell it to record/stop in actions. Creating a Recorder The first thing you […]

Also posted in Computer Music, Swift | Tagged , | 30 Responses