Mixing Audio Files

前端 未结 2 1975
轻奢々
轻奢々 2020-12-03 23:38

I have few audio files:

  • f_1 - length 10 sec
  • f_2 - length 3 sec
  • f_3 - length 1 sec

What I need is to find a way to mix(merge)

相关标签:
2条回答
  • 2020-12-04 00:23

    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.

    0 讨论(0)
  • 2020-12-04 00:39

    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.

    0 讨论(0)
提交回复
热议问题