I have two mono audio channels (pcm format) of audio call, incoming and outgoing. how to mix them? how to position them in space? (e.g. incoming channel sounds slightly on the left and outgoing on the right)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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. 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. For better results, a slight timeshift would be necessary, but that depends on your needs.
回答2:
Stereo PCM is just left and right interleaved, first all the bytes for one sample of the left channel then all the bytes for one sample on the right channel.