Is it possible to know the duration of an MP3 before the entire file is downloaded?
问题 This is a question about the file format of MP3s. I've been hunting for a way to get an MP3 duration. Since I'm using JLayer SPI to decode the MP3 I've discovered that this is possible where the audio source is a file. AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(source); Long microseconds = (Long) fileFormat.properties().get("duration"); System.out.println(microseconds); However when I take the similar code and the very same MP3 and change the source to a URL, JLayer does not