Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output audio settings when append one AAC file to another

My app records two audio files one by one using AVAudioRecorder with audio parameters:

        NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey,
                                    [NSNumber numberWithFloat:44100.0], AVSampleRateKey,
                                    [NSNumber numberWithInt:1], AVNumberOfChannelsKey,
                                    [NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
                                    [NSNumber numberWithInt:16],AVEncoderBitDepthHintKey,
                                    [NSNumber numberWithInt:128000], AVEncoderBitRateKey,
                                    nil];

I need append file2 at the end of file1. I'm using solution like there (appending two audio files by creating a AVMutableCompositionTrack after adding the two files and exporting the composition using exportAsynchronouslyWithCompletionHandler: method of AVAssetExportSession).
It works, but I have two input files 128kbs 44.1kHz 16bit mono, and output file format is: 219.4kbs 44.1kHz 16bit stereo.

Is any way to configure output audio file parameters for AVAssetExportSession?

like image 728
somedev Avatar asked Apr 14 '13 09:04

somedev


1 Answers

I was found the solution: SDAVAssetExportSession

like image 159
somedev Avatar answered Oct 07 '22 15:10

somedev