title: Converting Byte Array to Double Array
body: <p>I'm facing some problems with WAV files in Java.</p>
  <p>WAV format: PCM_SIGNED 44100.0 Hz, 24-bit, stereo, 6 bytes/frame, little-endian.</p>
  <ul>
  <li>I extracted the WAV data to a byte array with no problems.</li>
  <li>I'm trying to convert the byte array to a double array, but some doubles come with <code>NaN</code> value.</li>
  </ul>
  <p>Code:</p>
  <pre><code>ByteBuffer byteBuffer = ByteBuffer.wrap(byteArray);
  double[] doubles = new double[byteArray.length / 8];
  for (int i = 0; i &lt; doubles.length; i++) {
      doubles[i] = byteBuffer.getDouble(i * 8);
  }
  </code></pre>
  <p>The fact of being 16/24/32-bit, mono/stereo makes me confused.</p>
  <p>I intend to pass the <code>double[]</code> to a FFT algorithm and get the audio frequencies.</p>