1
votes

I have two audio files with .mp3 and .3gp with different timings but i want to mix those audios and produce one audio file with timings as first one. If 1st audio is 30sec and 2nd audio is 2min i want mixture of two audios which is of 30sec only. Once the first audio ends it should stop mixing. I want the audio to be saved in file.

Currently I'm succeful of playing two audios using mediaPlayer but i want them to be played only when mixing is complete.

1

1 Answers

0
votes

This sounds like you can accomplish it using FFMPEG. They have ported it over to Android here: https://github.com/WritingMinds/ffmpeg-android-java

With durations as low as those, I think the solution should be timely enough.

Once you get it setup, you'll run the command using the file path's from your code.

Here's an example of the code for audio mixing: https://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg