Save recorded file as mp4 audio

Go To


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,
2012-04-04 05:47
by Warewolf


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];
2012-06-12 07:51
by Ashwani Sharma