I want to record the sound and want to save the recorded file into document directory:- Had done Like:-
[[AVAudioSession sharedInstance]
setCategory: AVAudioSessionCategoryRecord
error: nil];
NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:16000.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];
recorderFilePath = [[NSString stringWithFormat:@"%@/Audio.caf", DOCUMENTS_FOLDER] retain];
NSURL *soundFileURL=[NSURL URLWithString:recorderFilePath];
recorderFilePath = [[NSString stringWithFormat:@"%@/Audio.caf", DOCUMENTS_FOLDER] retain];
NSURL *soundFileURL = [NSURL fileURLWithPath:recorderFilePath];
NSLog(@"str==>%@ soundurl==>%@",recorderFilePath,soundFileURL);
AVAudioRecorder *newRecorder =
[[AVAudioRecorder alloc] initWithURL: url
settings: settings
error: nil];
newRecorder.delegate = self;
[newRecorder prepareToRecord];
[newRecorder record];
and [recorder stop]; when stop recording is done.
Had seen this :- this
and coded accordingly..But still i am not able to create any .caf file into the document folder.