How can we save the recorded file as mp4 audio format in objective c . Can I have to change in the record settings to save as mp4 file.I have coded record settings as follow.Would u please help me to customize record settings for saving recorded audio file as mp4 format.
recordSettings= [[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithFloat: 32000], AVSampleRateKey,
[NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey,
[NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
nil];
Try this,
-(NSURL *) tempFileURL
{
NSString *outputPath = [[NSString alloc] initWithFormat:@"%@%@", NSTemporaryDirectory(), @"output.mp4"];
NSLog(@"Saved %@",outputPath);
NSURL *outputURL = [[NSURL alloc] initFileURLWithPath:outputPath];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:outputPath]) {
[fileManager removeItemAtPath:outputPath error:NULL];
}
[outputPath release];
return [outputURL autorelease];
}