混合音频文件
我有几个音频文件:
- f_1 - 长度 10 秒
- f_2 - 长度 3 秒
- f_3 - 长度 1 秒
我需要的是找到一种方法在 f_1 中的特定部分(即等于 6 的位置)混合(合并)f2 和 f3秒)
我正在查看音频示例,但它们对我没有多大帮助,因此任何可能有帮助的想法\参考文献\文档?
非常感谢!
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) 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,我认为设备上没有任何东西可以进行文件混合。在我看来,您有两个选择:
1)将两个文件发送到服务器并使用 ffmpeg 或其他一些免费工具来进行混音。
2) 如果它必须保留在手机本地,您可以使用 Android SoundPool 加载音频 (http://developer.android.com/reference/android/media/SoundPool.html)并将它们设置为同时播放。您可以在这里找到有关该主题的很好的教程: http: //www.droidnova.com/creating-sound-effects-in-android-part-1,570.html
声音池要求您管理多个文件,而不是对单个文件进行混音和播放。如果声音池允许您将输出捕获为 IOStream,那就太酷了,但是遗憾的是,SDK 似乎不允许这样做。此外,如果 AudioRecorder 允许您从音乐层获取流,那就太好了……但这看起来也不可能。音频输入列表: http://developer.android.com/reference/ android/media/MediaRecorder.AudioSource.html
我知道这并不完全是您正在寻找的内容,但希望您可以从某些链接中找到解决方法。
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.
将其转换为波形并进行 FFT,在所需范围内复用它(“手动”),然后进行 iFFT 并将其转换回 mp3 怎么样?
注意:这涉及一些数学,在实际编码之前您至少应该了解傅里叶变换的工作原理。
注意:我不知道是否有“库”允许访问 FFT、查找和/或复用。
如果我有思想缺陷,请纠正我,但我认为这应该有效。
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.