Reputation: 6465
I have two mp3 files, a.mp3 of 5 seconds and b.mp3 of 7 seconds and I want to mix them in order to generate c.mp3 of duration 7 secs. I have tried the following code Example 4 of the following link http://www.modejong.com/iOS/#ex4
but it mixes only caf files and I need to mix the MP3 files of different sizes.
Thanks-
Upvotes: 1
Views: 884
Reputation: 20551
Here for your requirement you can use this bellow demo code with convert two .mp3
or caf
file to one file , see the tutorial and get some idea and also use these Demos ..
Please see this bellow links with sample codes and tutorials..
i hope this help you...
Upvotes: 1
Reputation: 107231
You need to use AVMutableCompositionTrack and AVAssetExportSession Class to do it.
Here is a sample code on developer.Apple.com.
This is a nice tutorial which merge two video files and one music file into a single file. This same code can be reused to merge two audio files.
Upvotes: 3