public long getNumberOfSamples() {
        if (this.isMpeg) {
            // audioInputStream.getFrameLength() returns -1 for MP3s
            // thus another method is needed:
            // the following WORKAROUND will approximate the number of samples only
            // - usually it is SMALLER!

            return this.durationMicrosec / 1000 * (long) this.sampleRate / 1000;
        } else
            return this.audioInputStream.getFrameLength();
    }