Mixing Audio Files

本小妞迷上赌 提交于 2019-11-28 01:22:12

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.

What about converting it to wave and doing a FFT, muxxing it at the desired range ["by hand"] and doing an iFFT and convert it back to mp3.

Note: This involves some math and you should know at least something about how Fourier Transformation works before actual coding.

Note: I don't know if there are "libs" that allow pleasent access to FFT, seeking and/or muxing.

Please correct me if I got a mindflaw, but I think this should work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!