title: How to normalize mixed WAV files
body: <p>I am trying to mix two WAV files.</p>
  
  <p>The WAV files are available as byte arrays and I am using below code to mix the two. </p>
  
  <pre><code>byte[] byte1 , byte[] byte2
  
  // 44 is header of wav file
  for( int i = 44 ; i &lt; byte1.length ; i++){
     byte1[i] = byte1[i] + byte2[i];
  }
  </code></pre>
  
  <p>The above code mostly works. But when the result is more than maximum wave (16 bit audio file),  it has noise. How can I normalize mixed sound?</p>