[英]White noise mixing 2 audio byte array
I'm mixing 2 audio bytes arrays getting the mix with some white noise. 我正在混合2个音频字节数组,使混合时带有一些白噪声。
for (int i=0;i<bytes1.getB1().length;i++){
mixBytes[i]=(byte) (bytes1[i]+bytes2[i]);
}
Anyone knows how to solve the white noise problem ? 有人知道如何解决白噪声问题吗?
I'm getting the bytes with this method, removing the 44 first bytes as wav header. 我通过这种方法获取字节,删除了44个头字节作为wav标头。
private byte[] getISByteArray(InputStream is){
ByteArrayOutputStream stream = new ByteArrayOutputStream();
int length;
try {
while ((length = is.read()) != -1) {
stream.write(length);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
byte[] b=stream.toByteArray();
byte[] b2=new byte[b.length-44];
//System.arraycopy(b, 44, b2, 0, b2.length);
for (int i=0;i<b.length;i++){
if (i>44) b2[i-44]=b[i];
}
return b2;
} }
I can see two potential problems immediately: 我可以立即看到两个潜在的问题:
For the latter, this might help - although it depends on whether the bytes are really linear amplitude etc, just by taking the average: 对于后者,这可能会有所帮助-尽管仅取决于平均值,这取决于字节是否真的是线性幅度等。
mixBytes[i]=(byte) ((bytes1[i]+bytes2[i]) / 2);
I suspect that will make it slightly better, but it's still not a great mixing function... 我怀疑这会使它稍微好一点,但是它仍然不是很好的混合功能...
用低通高斯滤波器对原始信号进行卷积,将消除白噪声。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.