private void readFile() {
        if (audioFileSpecified) {
            try {
                this.is = AudioSystem.getAudioInputStream(this.file);
                byte[] tmp = new byte[(int) this.duration * this.sampleSize];
                this.is.read(tmp);
                this.is.close();
                ByteArrayInputStream bis = new ByteArrayInputStream(tmp);
                // convert to floats
                this.sampleData = new float[(int) this.duration];
                byte[] sampleWord = new byte[sampleSize];
                for (int i = 0; i < this.duration; i++) {
                    if (bis.read(sampleWord) == -1) {
                        //this.finished = true;
                        System.out.println("Ran out of samples to read");
                    } else {
                        sampleData[i] = this.getFloat(sampleWord);
                    }
                }
                bis.close();
            } catch (UnsupportedAudioFileException uafe) {
                //??
            } catch (IOException ioe) {
                ioe.printStackTrace();
            }
        } else { // read any file as raw byte=sample data
            Vector buffer = new Vector();
            try {
                FileInputStream fis = new FileInputStream(this.fileName);
                int val = fis.read();
                while (val != -1) {
                    buffer.addElement(new Float((float) val / 255f));
                    val = fis.read();
                }
                fis.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
                System.exit(1);
            }
            // convert to float array
            int max = buffer.size();
            this.sampleData = new float[max];
            for (int i = 0; i < max; i++) {
                sampleData[i] = (((Float) buffer.elementAt(i)).floatValue());
            }
        }
    }