Tag Archives: AVFoundation

The Great AVAudioUnitSampler workout

Swift Language

The Great AVAudioUnitSampler workout Table of Contents Introduction Sampler from SoundFont Sampler from aupreset Sampler from sound files Multiple voices Summary Resources Introduction Table of Contents Little by little, AVFoundation audio classes are taking over Core Audio. Unfortunately, the pace is glacial so Core Audio is going to be around for another eon or so. […]

Posted in AVFoundation, Swift | Also tagged | 7 Responses

Swift 2: AVFoundation to play audio or MIDI

Swift Language

Swift AVFoundation There are many ways to play sound in iOS. Core Audio has been around for a while and it is very powerful. It is a C API, so using it from Objective-C and Swift is possible, but awkward. Apple has been moving towards a higher level API with AVFoundation. Here I will summarize […]

Posted in Core MIDI, Swift | Also tagged , | 13 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 […]

Posted in Computer Music, Core Audio, Swift | Also tagged | 6 Responses

Swift 2 AVAudioSequencer

Swift Language

Swift 2 AVAudioSequencer There’s a brand new MIDI sequencer class in Swift 2 beta! It’s the AVAudioSequencer. Introduction AVAudioSequencer Setup AVAudioEngine Setup AVMusicTrack Summary Update Resources Introduction Table of Contents At WWDC15 there was a presentation entitled “What’s New in Core Audio“. If you were able to get past the first 29 minutes of a […]

Posted in Apple, Computer Music, Core MIDI, MIDI, Swift | Also tagged | 12 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 […]

Posted in AVFoundation, Computer Music, Swift | Also tagged | 30 Responses

Swift AVFoundation to play audio or MIDI

Swift Language

Swift AVFoundation There are many ways to play sound in iOS. Core Audio has been around for a while and it is very powerful. It is a C API, so using it from Objective-C and Swift is possible, but awkward. Apple has been moving towards a higher level API with AVFoundation. Here I will summarize […]

Posted in Swift | Also tagged | 28 Responses