private float computeStreamDuration(){
        // for uncached stream sources, the granule position is not known.
        if (oggStream instanceof UncachedOggStream)
            return -1;
        
        // 2 bytes(16bit) * channels * sampleRate
        int bytesPerSec = 2 * streamHdr.getChannels() * streamHdr.getSampleRate();
        
        // Don't know how many bytes are in input, pass MAX_VALUE
        int totalBytes = getOggTotalBytes(Integer.MAX_VALUE);
        
        return (float)totalBytes / bytesPerSec;
    }
Returns the total of expected OGG bytes. 

@param dataBytesTotal The number of bytes in the input
@return If the computed number of bytes is less than the number
of bytes in the input, it is returned, otherwise the number 
of bytes in the input is returned.
jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java