Recording audio is a complex process – for any computer. iOS makes it simple-ish with several classes courtesy of the AV Foundation Framework.
In this example we’ll record audio from the device microphone. This happens in four steps:
- create an AVSession
- setup a dictionary with audio recorder settings
- create an AVAudioRecorder
- prepare for and start recording
For the method below to work you need to import and link the AVFoundation Framework to your project. We also need a property to hold our AVRecorder object, otherwise it will no longer exist by the time the method reaches the end and nothing will work. Again.
Here’s a method that is called by a “Record Button”:

Additional delegate methods are available to check for a “higher power” interruption, such as a phone call.
- https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html
- https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVFoundationAudioSettings_Constants/Reference/reference.html#//apple_ref/doc/uid/TP40009937
- http://pinkstone.co.uk/how-to-play-audio-in-ios/