简体   繁体   English

如何混合两个音频通道?

[英]how to mix two audio channels?

I have two mono audio channels (pcm format) of audio call, incoming and outgoing.我有两个音频呼叫的单声道音频通道(pcm 格式),传入和传出。 how to mix them?如何混合它们? how to position them in space?如何在空间中定位它们? (eg incoming channel sounds slightly on the left and outgoing on the right) (例如,传入通道在左侧略有声音而在右侧略有传出)

Mixing is just a weighted addition of both signals.混合只是两个信号的加权相加。 So if you want them to be equal in one mono signal, lower both signals by a factor of 2 and add them.因此,如果您希望它们在一个单声道信号中相等,请将两个信号降低 2 倍并将它们相加。 If you want to position them in the stereo space, use different weighting on the left and right channel.如果要将它们放置在立体声空间中,请在左右声道上使用不同的权重。 For example 0.6 of signal 1 and 0.4 of signal 2 on the left channel and vice versa on the right channel will do the trick.例如,左通道上信号 1 的 0.6 和信号 2 的 0.4 以及右通道上的反之亦然。 For better results, a slight timeshift would be necessary, but that depends on your needs.为了获得更好的结果,需要稍微进行时移,但这取决于您的需要。

立体声 PCM 只是左右交错,首先是左声道一个样本的所有字节,然后是右声道一个样本的所有字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM