[英]How to convert two channel audio into one channel audio
I am playing around with some audio processing in python. 我在玩一些python音频处理。 Right now I have the audio as a 2x(Large Number) numpy array. 现在,我将音频作为2x(Large Number)numpy数组。 I want to combine the channels since I only want to try some simple stuff. 我只想尝试一些简单的东西,所以想合并渠道。 I am just unsure how I should do this mathematically. 我只是不确定如何数学上做到这一点。 At first I thought this is kind of like converting an RGB image to gray-scale where you would average each of the color channels to create a gray pixel. 起初,我认为这有点像将RGB图像转换为灰度图像,在该图像中,您将平均每个颜色通道以创建一个灰色像素。 Then I thought that maybe I should add them due to the superposition principal of waves (then again average is just adding and dividing by two.) Does anyone know the best way to do this? 然后我想也许是由于波的叠加原理而应该将它们相加(然后平均值又只是相加并除以2。)有人知道这样做的最好方法吗?
i handle this by using Matlab.python can do the same. 我通过使用Matlab.python处理此问题。 (left-channel+right-channel)/2.0 (左声道+右声道)/2.0
To convert any stereo audio to mono, what I have always seen is the following: 要将任何立体声音频转换为单声道,我一直看到以下内容:
For each pair of left and right samples: 对于每对左右样本:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.