如何合并两个mp3文件iOS? [英] How to merge two mp3 files iOS?

查看:154
本文介绍了如何合并两个mp3文件iOS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有用户录制和另一个mp3文件,我希望用户能够将这两个文件导出为一个,这意味着两个文件将以某种方式合并或相互叠加。

I have a user recording and another mp3 file in my app, and I want the user to be able to export both of these as one, meaning the two files will be merged or laid over each other in some way.

如果不理解,两个mp3文件将同时播放,就像用户可以录制的任何应用程序,一首歌,一首歌一样。工具。

In case that wasn't understood, both mp3 files are to be played at the same time just as any app where a user can record say, a song, over an instrumental.

录音和乐器是两个独立的mp3文件,需要导出为一个。

The recording and the instrumental are two separate mp3 files that need to be exported as one.

我该怎么做呢?从我读过的,我找不到解决方案。我在连接两个音频文件时看到了很多,但我不希望它们一个接一个地播放,而是在同一时间播放。

How do I go about doing this? From what I've read, I can't find the solution. I see a lot on concatenating the two audio files, but I don't want them to play one after another, but rather at the same time.

谢谢。

编辑:我知道这已经很晚了,但是如果有人因此而绊倒并且正在寻找示例代码,那么我的答案就在这里:我如何重叠音频文件并在Xcode中结合iPhone?

I know this is late, but in case anyone stumbles by this and was looking for sample code, it's in my answer here: How can I overlap audio files and combine for iPhone in Xcode?

推荐答案

如果我找到你,你就要求提供音频混音功能。这不是一项微不足道的任务。
查看 Core Audio 。一本好书就是这一本
一个解决方案就是创建一个无GUI的音频单元(混音器单元)来播放,混合和渲染两个信号(mp3)。

If I get you right, you are asking for a audio mixer feature. This is not a trivial task. Take a look at Core Audio. A good book to start with is this one. One solution would be, to create a GUI-less Audio Unit (mixer unit) that plays, mixes and renders both signal (mp3s).

除了编程方面,这里还有一个音频工程方面:你应该注意信号的水平。想象一下,你有2个相同的mp3,在0dB的水平。如果你总结一下,你的等级将是+ 3dB。这在数字世界中不存在(0dB是最大值)。因此,你必须在混合之前降低输入水平。

Besides the programming aspect, there is also an audio engineering aspect here: you should take care of the level of the signals. Imagine you have 2 identical mp3s at a level of 0dB. If you sum them up, your level will be +3dB. This don't exist in the digital world (0dB ist the maximum). Because of that, you would have to reduce the input levels before mixing.

编辑:对于迟到的输入感到抱歉,但这可能会对将来有所帮助: Apple有一个例子对于我刚刚实现的音频混音器。

sorry for the late input, but maybe this helps someone in the future: Apple has an example for the Audio Mixer that I just stumpled upon.

这篇关于如何合并两个mp3文件iOS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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