addMetadata(metadata, fileFormat.properties()); addMetadata(metadata, audioFormat.properties()); } catch (UnsupportedAudioFileException e) {
@Nullable public Duration getDuration() { if (infoFormat.properties().containsKey("duration")) { long microDuration = (long) infoFormat.properties().get("duration"); return Duration.ofMillis(TimeUnit.MICROSECONDS.toMillis(microDuration)); } return null; }
File file = new File("filename.mp3"); AudioFileFormat baseFileFormat = new MpegAudioFileReader().getAudioFileFormat(file); Map properties = baseFileFormat.properties(); Long duration = (Long) properties.get("duration");
File file = new File("filename.mp3"); AudioFileFormat baseFileFormat = AudioSystem.getAudioFileFormat(file); Map properties = baseFileFormat.properties(); Long duration = (Long) properties.get("duration");
File file = new File("filename.mp3"); AudioFileFormat baseFileFormat = new MpegAudioFileReader().getAudioFileFormat(file); Map properties = baseFileFormat.properties(); Long duration = (Long) properties.get("duration");
File file = new File("filename.mp3"); AudioFileFormat baseFileFormat = AudioSystem.getAudioFileFormat(file); Map properties = baseFileFormat.properties(); Long duration = (Long) properties.get("duration");
public boolean hasProperty(@Nonnull String key) { return infoFormat.properties().containsKey(key); }
@Nullable public String getProperty(String key) { return hasProperty(key) ? infoFormat.properties().get(key).toString() : null; }
mapa.putAll(format.properties()); Object o = format.properties().get("duration");
public SoundInfo(@Nonnull File file) throws SoundException { this.file = file; try { this.infoFormat = AudioSystem.getAudioFileFormat(getFile().handle()); this.properties = new XBasicView<>(new XLinkedMap<>(infoFormat.properties())); } catch (IOException exception) { throw new SoundException(exception); } catch (UnsupportedAudioFileException exception) { throw new SoundException("Unsupported audio file: " + file.getFullName() + " [" + file.getFormat() + ']'); } }
addMetadata(metadata, fileFormat.properties()); addMetadata(metadata, audioFormat.properties()); } catch (UnsupportedAudioFileException e) {
addMetadata(metadata, fileFormat.properties()); addMetadata(metadata, audioFormat.properties()); } catch (UnsupportedAudioFileException e) {