I have successfully used these recording settings to create audio formatted into the needed format. However these settings only seemed to work with AVAudioRecorder. When I try them with AVAssetWriter I get an error stating that the AVLinearPCMBitDepthKey needs AVLinearPCMBitFloatKey but when I add that it says its not allowed for 'ulaw'. My question is why does AVLinearPCMBitDepthKey work fine in one recorder but not the other?
[recordSettings setObject:[NSNumber numberWithInt: kAudioFormatULaw] forKey: AVFormatIDKey];
[recordSettings setObject:[NSNumber numberWithFloat:8000.0] forKey: AVSampleRateKey];//was 44100.0
[recordSettings setObject:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey];
[recordSettings setObject:[NSNumber numberWithInt:8000] forKey:AVEncoderBitRateKey];//was 64000
[recordSettings setObject:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
[recordSettings setObject:[NSNumber numberWithInt: AVAudioQualityLow] forKey: AVEncoderAudioQualityKey];