0Pricing
Swift Academy · Lesson

Recording Audio

Capture microphone input to a file.

Recording with AVAudioRecorder

AVAudioRecorder captures audio from the microphone to a file with minimal setup—ideal for voice memos and simple recorders.

import AVFoundation

Microphone Permission

Recording requires user permission. Add NSMicrophoneUsageDescription to Info.plist and request access before recording.

AVAudioApplication.requestRecordPermission { granted in
    if granted { /* start recording */ }
}

All lessons in this course

  1. Playing Media with AVPlayer
  2. Recording Audio
  3. AVAsset and Composition
  4. Embedding Players in SwiftUI
← Back to Swift Academy