1
        It's working for two prerecorded wav files of same characteristics(sample rate,channel,bitspersample etc) but with a recorded voice it creates white noises in output.

How can we reduce white noise from mixed sound?

Is there any native library to do that?

    byte[] output = new byte[(music1.length > music2.length) ? music2.length
            : music1.length];
    for (int i = 0; i < output.length; i++) {

        float samplef1 = music1[i] / 128.0f; // 2^7=128
        float samplef2 = music2[i] / 128.0f;

        float mixed = (samplef1 + samplef2) / 2;

                if (mixed > 1.0f)
            mixed = 1.0f;

        if (mixed < -1.0f)
            mixed = -1.0f;

        byte outputSample = (byte) (mixed * 128.0f);
        output[i] = outputSample;
    }
rvp
  • 11
  • 1

0 Answers0