混合音频文件 [英] Mixing Audio Files

查看:177
本文介绍了混合音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个音频文件:




  • f_1 - 长度10秒

  • f_2 - 长度3秒

  • f_3 - 长度1秒



我需要的是找到一种方法f_1中的特定部分混合(合并)f2和f3(即等于6秒的位置)



我正在看音频示例,但不帮助我很多任何想法可以帮助你的文件?



非常感谢!

解决方案

不幸的是,我认为设备上没有任何文件混合。如我所见,您有两个选择:



1)将这两个文件发送到服务器,并使用ffmpeg或其他一些免费工具进行mixdown。 p>

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



我知道这并不完全符合您的要求,但希望您能从一些链接。


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!

解决方案

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.

这篇关于混合音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆