I have a couple of M4A (sound) files. I want to combine into a single sound file. Can this using ffmpeg library in android.
I tried this way.
public void myFunctionMergeAudioFiles(ShellCallback sc,List<String> mListFiles, String outPath) throws IOException, InterruptedException
{
ArrayList<String> cmd = new ArrayList<String>();
cmd = new ArrayList<String>();
cmd.add(ffmpegBin);
cmd.add("f");
cmd.add("concat");
cmd.add("-i");
for(int i=0;i<mListFiles.size();i++){
cmd.add(new File(mListFiles.get(i)).getCanonicalPath());
}
cmd.add("-c");
cmd.add("-acodec");
cmd.add("aac");
cmd.add("copy");
File fileOut = new File(outPath);
cmd.add(fileOut.getCanonicalPath());
execFFMPEG(cmd, sc);
}
My Log:-
01-23 15:32:17.841: D/FFMPEG(12678): /data/app-lib/com.apps.messagingapp-1/libffmpeg.so f concat -i /storage/emulated/0/MGOApp/Temp/Recording #1_0.m4a /storage/emulated/0/MGOApp/Temp/Recording #1_1.m4a /storage/emulated/0/MGOApp/Temp/Recording #1_2.m4a -c -acodec aac copy /storage/emulated/0/MGOApp/Recording #1.m4a
But i am not getting any error. Thanks in advance.