title: Normalizing audio, how to convert a float array to a byte array?
body: <p>Hi all, I am playing an audio file. I read it as a <code>byte[]</code> and then I need to normalize the audio by putting values into range of [-1,1]. I want to then put each float value into a <code>byte[i]</code> array and then put that <code>byte[]</code> back into the playing audio player. </p>
  
  <p>I've tried this:</p>
  
  <pre><code>byte[] data = ar.ReadData();
  byte[] temp=new byte[data.Length];
  float biggest= 0; ;
  for (int i = 0; i &lt; data.Length; i++)
  {
      if (data[i] &gt; biggest)
      {
          biggest= data[i];
      }
  }
  </code></pre>
  
  <p>This part of code should put for example 0.43 int byte[] if that is even possible I tried this but it's not working:</p>
  
  <pre><code>for (int i = 0; i &lt; data.Length; i++)
  {
      temp = BitConverter.GetBytes(data[i] * (1 / biggest));
  }
  </code></pre>