Sample code demonstrating audio recording features for iOS using SwiftUI.
This is a sample code project providing minimal audio recording functionality. This repository demonstrates basic implementation patterns and is not intended for production use.
- Real-time audio recording with visual level monitoring
- Saves only the most recent recording (previous recordings are automatically deleted)
- WAV format only (PCM Int16, 44.1kHz)
- Support for various audio input devices (iPhone microphone, AirPods, Bluetooth devices)
- Simple playback of recorded audio
- SwiftUI-based user interface
Built with SwiftUI and AVFoundation framework for iOS. Utilizes AVAudioEngine for real-time audio processing, AVAudioSession for device management, and AVAudioPlayer for playback. Implements @Observable macros for state management with comprehensive error handling and thread-safe audio queue processing.
- iOS 16.0+
- Xcode 15.0+
- Swift 5.9+
- Only supports WAV format (.wav files with PCM Int16 encoding)
- Saves only the last recording (no recording history)
- Minimal support - basic functionality only
- Temporary file storage (files are deleted when app is terminated)
- Clone this repository
git clone https://github.com/notoroid/SimpleAudioRecord.git-
Open
SimpleAudioRecord.xcodeprojin Xcode -
Build and run on your device or simulator
- Grant microphone permission when prompted
- Tap the record button to start recording
- Tap again to stop recording
- Use the play button to listen to your recording
MIT License - See LICENSE file for details
Kaname Noto (@notoroid)
This is sample code for learning purposes. For production applications, consider implementing:
- Multiple recording format support (AAC, MP3, etc.)
- Recording history management
- Persistent storage
- Advanced audio processing features
- Comprehensive error handling and recovery