try (InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
inputStream.mark(MARK_LIMIT);
AudioFileFormat aff = getAudioFileFormat(inputStream);
inputStream.reset();
// Get Vorbis file info such as length in seconds.
VorbisFile vf = new VorbisFile(file.getAbsolutePath());
return getAudioFileFormat(inputStream, (int) file.length(), (int) Math.round((vf.time_total(-1)) * 1000));
} catch (SoundException e) {
throw new IOException(e.getMessage());
}
}