public int readSamples(byte[] buf, int offset, int length) {
        if (!open || eof) {
            return -1;
        }

        try {
            int totalRead = in.read(buf, offset, length);
            if (totalRead < 0) {
                eof = true;
            }
            return totalRead;
        } catch (IOException ex) {
            ex.printStackTrace();
            eof = true;
            return -1;
        }
    }
Reads samples from the stream. The format of the data depends on the
getSampleRate(), getChannels(), getBitsPerSample() values.

@param buf Buffer where to read the samples
@param offset The offset in the buffer where to read samples
@param length The length inside the buffer where to read samples
@return number of bytes read.
jme3-core/src/main/java/com/jme3/audio/AudioStream.java