To record audio on a real iOS device, remember to config audio session before a recording is started.
An audio session is the intermediary between an app and iOS used to configure the appโs audio behaviour. If category "AVAudioSessionCategoryPlayAndRecord" is set, it defines iOS audio behaviour to allow audio input (recording) and output (playback).
To record audio in iLBC format, noted to remove AVSampleRateKey key in settings and change file extension to "ilbc" is necessary.
let audioSession = AVAudioSession.sharedInstance() do { try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord) } catch let error as NSError { print(error.description) } let recordSettings = [AVSampleRateKey : NSNumber(float: Float(44100.0)), AVFormatIDKey : NSNumber(int: Int32(kAudioFormatMPEG4AAC)), AVNumberOfChannelsKey : NSNumber(int: 1), AVEncoderAudioQualityKey : NSNumber(int: Int32(AVAudioQuality.Max.rawValue))] do{ try recorder = AVAudioRecorder(URL: getFileURL(), settings: recordSettings) recorder.delegate = self recorder.prepareToRecord() } catch let error as NSError { error.description }
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
โ Live Streamingโ Interactive Chatโ Private Showsโ HD Qualityโ Free Actions
Free to watch โข No registration required โข HD streaming
Top Posts Tagged with #av foundation framework | Tumlook