在 Java(API) 中合并两个音频文件(非 concat)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12568326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 09:24:37  来源:igfitidea点击:

Merge two audio files(not concat) in Java(API)

javaaudio

提问by Drew H

Hey guys I need to merge two audio files together. Basically place one audio file on top of another and make one file. I've seen some posts on concatenating two audio files but none on this. Thanks for any help.

嘿伙计们,我需要将两个音频文件合并在一起。基本上将一个音频文件放在另一个文件上并制作一个文件。我看过一些关于连接两个音频文件的帖子,但没有。谢谢你的帮助。

回答by Neil

I recommend you take a look at JSyn. I would discourage you to attempt to do it yourself, since it can get complicated with multiple audio formats. It supports a lot more as well.

我建议你看看JSyn。我不鼓励你尝试自己做,因为它可能会因多种音频格式而变得复杂。它也支持更多。

回答by Winnifred

This worked for me. Use jresources.org to help you. You could use their example: http://www.jsresources.org/examples/MixingAudioInputStream.java.html. For the org.tritonus.share.sampled.TConversionTool package, if you have problems using their library, then download their source code (http://sourceforge.net/projects/tritonus/files/): it's open source, and try using it. I tried it and it worked for me :D. I'm grateful for those guys!

这对我有用。使用 jresources.org 来帮助您。您可以使用他们的示例:http: //www.jsresources.org/examples/MixingAudioInputStream.java.html。对于 org.tritonus.share.sampled.TConversionTool 包,如果您在使用他们的库时遇到问题,请下载他们的源代码(http://sourceforge.net/projects/tritonus/files/):它是开源的,并尝试使用它。我试过了,它对我有用:D。我很感谢那些人!