androidaudiomixing

Mixing Audio Files


I have few audio files:

What I need is to find a way to mix(merge) f2 and f3 at particular section in f_1 (i.e. position which is equal to 6 sec)

I was looking at Audio examples but they don't help me much so any ideas\references\ documentation that might help?

Many Thanks!


Solution

  • Unfortunately, I don't think there's anything on the device to do file mixdowns. As I see it, you've got two options:

    1) Send both files to a server and use ffmpeg or some other free tool to do the mixdowns.

    2) If it's something that must stay local to the phone, you could load the audio using the Android SoundPool (http://developer.android.com/reference/android/media/SoundPool.html) and set them to play at the same time. You can find a good tutorial on the subject here: http://www.droidnova.com/creating-sound-effects-in-android-part-1,570.html

    The sound pool requires you to manage multiple files rather than doing mixdowns and playback of a single file. It would be cool if the soundpool let you grap the output as a IOStream but, alas, the SDK doesn't seem to allow it. Further, it would be nice if the AudioRecorder allowed you to grab a stream from the music layer...but that doesn't look possible either. List of audio inputs: http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html

    I know this isn't exactly what you're looking for, but hopefully you can get a workaround from some of the links.