Output sound settings when adding one AAC file to another

My application records two audio files one by one using AVAudioRecorder with sound 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 to add file2 to the end of file1. I use a solution, for example there (adding two audio files by creating an AVMutableCompositionTrack after adding two files and exporting the composition using the exportAsynchronouslyWithCompletionHandler: method for AVAssetExportSession).
It works, but I have two input files: 128kbs 44.1kHz 16bit mono, and the output file format: 219.4kbs 44.1kHz 16bit stereo.

Can I customize the output audio file settings for AVAssetExportSession?

+6
source share
1 answer

I found a solution: SDAVAssetExportSession

+3
source

All Articles