I have successfully used these recording options to create the audio format in the desired format. However, these settings seemed to work with AVAudioRecorder. When I try them using AVAssetWriter, I get an error message indicating that AVLinearPCMBitDepthKey needs AVLinearPCMBitFloatKey, but when I add that it says it is not allowed for 'ulaw'. My question is: why does AVLinearPCMBitDepthKey work fine on one recorder, but not on the other?
[recordSettings setObject:[NSNumber numberWithInt: kAudioFormatULaw] forKey: AVFormatIDKey]; [recordSettings setObject:[NSNumber numberWithFloat:8000.0] forKey: AVSampleRateKey];
source share