算法混合​​声音 [英] Algorithm to mix sound

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

问题描述

我有我需要添加在一起的两个原始声音流。对于这个问题的目的,我们可以假设它们是相同的比特率和比特深度(说16位采样,44.1kHz的采样率)。

I have two raw sound streams that I need to add together. For the purposes of this question, we can assume they are the same bitrate and bit depth (say 16 bit sample, 44.1khz sample rate).

显然,如果我只是将它们添加在一起我会溢出和下溢我的16位空间。如果我加入他们在一起,除以2,然后每个体积减半,这是不正确的声波 - 如果两个人都讲在一个房间里,他们的声音不会成为一半安静,和一个麦克风可以拾取它们无论起来没有击中的限制。

Obviously if I just add them together I will overflow and underflow my 16 bit space. If I add them together and divide by two, then the volume of each is halved, which isn't correct sonically - if two people are speaking in a room, their voices don't become quieter by half, and a microphone can pick them both up without hitting the limiter.

  • 那么什么是一起添加这些声音在我的软件调音台的正确方法是什么?
  • 我是错的,正确的方法是降低各一半的音量?
  • 请我需要添加一个COM pressor ​​/限制器或其他一些处理阶段得到数量和混合效果我想的呢?

推荐答案

您应该添加它们放在一起,但剪辑的结果在允许范围为prevent上/下溢。

You should add them together, but clip the result to the allowable range to prevent over/underflow.

在剪裁发生的历史事件,您引入失真到音频,但这是不可避免的。您可以使用裁剪code,以检测这一条件,并报告给用户/操作员(红'夹'光相当于一个混音器...)

In the event of the clipping occuring, you will introduce distortion into the audio, but that's unavoidable. You can use your clipping code to "detect" this condition and report it to the user/operator (equivalent of red 'clip' light on a mixer...)

您可以实现一个更正确的COM pressor ​​/限幅器,但不知道您的具体应用,这是很难说,如果这将是值得的。

You could implement a more "proper" compressor/limiter, but without knowing your exact application, it's hard to say if it would be worth it.

如果你正在做大量的音频处理,你可能要重新present你的音频电平为浮点值,只有回到16位空间的过程结束。高端数字音频系统经常以这种方式工作。

If you're doing lots of audio processing, you might want to represent your audio levels as floating-point values, and only go back to the 16-bit space at the end of the process. High-end digital audio systems often work this way.

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

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