title: Waveform for 24/32 bit WAV files
body: <p>I'm working with WAV files in Java and I created a waveform, but it's only able to show the waveform from a 16 bit file. I create one loop for the samples frames and other for the channels, allowing creating waveforms for each channel.</p>
  
  <pre><code>for (int indexNumSampleFrames = 0; indexNumSampleFrames &lt; intNumSampleFrames; indexNumSampleFrames++) {
      for (int indexNumChannels = 0; indexNumChannels &lt; intNumChannels; indexNumChannels++) {
  
          long lgnAmplitude = 0;
  
          lgnAmplitude = (short) ( arrayData[intPointer] &amp; 0xff) | 
                     (short) ((arrayData[intPointer + 1] &amp; 0xff) &lt;&lt; 8);
  
          intPointer += intBytesPerSample;
  
          matrixAmplitudes[indexNumChannels][intSampleIndex] = lgnAmplitude;
      }
  
      intSampleIndex++;
  }
  </code></pre>
  
  <p>I'm struggling to create the waveform for 24 and 32 bits... I tried to find any solution but I couldn't, and I also tried the following code without success.</p>
  
  <pre><code>lgnAmplitude = (long) ( arrayData[intPointer] &amp; 0xff) | 
                                 (long) ((arrayData[intPointer + 1] &amp; 0xff) &lt;&lt; 8) |
                                 (long) ((arrayData[intPointer + 2] &amp; 0xff) &lt;&lt; 16);
  </code></pre>
  
  <p>Thanks in advance!</p>