waveform code .. ..I do need help...please
<p>Can you please , explain to me (in words) what this code does?
thank you</p>

<p>My concerns are actually these two parts :
1)</p>

<pre><code>double y_new = (double) (h * (128 - my_byte) / 256);
lines.add(new Line2D.Double(x, y_last, x, y_new));
y_last = y_new;
</code></pre>

<p>2) the for loop , I dont'understand...
   what's 32768 ? 
   my_byte?</p>

<pre><code>        int numChannels = format.getChannels();
        for (double x = 0; x &lt; w &amp;&amp; audioData != null; x++) {

        int idx = (int) (frames_per_pixel * numChannels * x);
        // se a 8 bit è immediato
        if (format.getSampleSizeInBits() == 8) {
            my_byte = (byte) audioData[idx];
        } else {
            my_byte = (byte) (128 * audioData[idx] / 32768);
</code></pre>

<p>Here's the code . It was taken from here :
<a href="http://www.koders.com/java/fid3508156A13C80A263E7CE65C4C9D6F5D8651AF5D.aspx?s=%22David+Anderson%22" rel="nofollow">http://www.koders.com/java/fid3508156A13C80A263E7CE65C4C9D6F5D8651AF5D.aspx?s=%22David+Anderson%22</a>
(class Sampling Graph)</p>

<pre><code>        int frames_per_pixel = audioBytes.size() / format.getFrameSize() / w;
        byte my_byte = 0;
        double y_last = 0;
        int numChannels = format.getChannels();
        for (double x = 0; x &lt; w &amp;&amp; audioData != null; x++) {
        // scegli quale byte visualizzare
        int idx = (int) (frames_per_pixel * numChannels * x);
        // se a 8 bit è immediato
        if (format.getSampleSizeInBits() == 8) {
            my_byte = (byte) audioData[idx];
        } else {

            my_byte = (byte) (128 * audioData[idx] / 32768);
        }

        double y_new = (double) (h * (128 - my_byte) / 256);
        lines.add(new Line2D.Double(x, y_last, x, y_new));
        y_last = y_new;
        }

        repaint();
</code></pre>
