如何将两个mp3音频文件混合/叠加到一个mp3文件中(不连接) [英] How to mix / overlay two mp3 audio file into one mp3 file (not concatenate)

查看:415
本文介绍了如何将两个mp3音频文件混合/叠加到一个mp3文件中(不连接)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将两个mp3文件合并为一个mp3文件.例如,如果第一个文件为1分钟,第二个文件为30秒,则输出应为一分钟.在那一分钟内,它应该同时播放两个文件.

I want to merge two mp3 files into one mp3 file.for example if 1st file is 1min and 2nd file is 30 sec then the output should be one min. In that one min it should play both the files.

推荐答案

首先,要混合两个音频文件,您需要操纵其原始表示形式;由于 MP3文件已压缩,因此您无法直接访问信号的原始表示.您需要对压缩的MP3流进行解码,以便理解"音频信号的波形,然后才能将它们混合.

First of all, in order to mix two audio files you need to manipulate their raw representation; since an MP3 file is compressed, you don't have a direct access to the signal's raw representation. You need to decode the compressed MP3 stream in order to "understand" the wave form of your audio signals and then you will be able to mix them.

因此,为了将两个压缩音频文件混合成一个压缩音频文件,需要执行以下步骤:

Thus, in order to mix two compressed audio file into a single compressed audio file, the following steps are required:

  1. 解码,使用解码器获取原始数据(没有可用的PUBLIC SYSTEM API,您需要手动进行操作!).
  2. 混合两个未压缩的原始数据流(必要时应用音频剪辑).为此,您需要考虑使用 decoder 获得的原始数据格式( PCM )
  3. 编码原始混合数据到压缩的MP3文件中(根据解码器,您需要使用 encoder 手动进行处理)
  1. decode the compressed file using a decoder to obtain the raw data (NO PUBLIC SYSTEM API available for this, you need to do it manually!).
  2. mix the two raw uncompressed data streams (applying audio clipping if necessary). For this, you need to consider the raw data format obtained with your decoder (PCM)
  3. encode the raw mixed data into a compressed MP3 file (as per the decoder, you need to do it manually using an encoder)

可以在此处找到有关MP3解码器的更多信息.

More info aboud MP3 decoders can be found here.

这篇关于如何将两个mp3音频文件混合/叠加到一个mp3文件中(不连接)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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