Accessing to the metadata of a song file in Java FX?
I'm writing some code for a simple music player in Java FX, I'm trying to
get the metadata set, like title, artist, genre, etc.
I wrote this testing code but the "metadata" I'm getting is just an empty
set.
for (File file : lista) {
ObservableMap<String, Object> metadata = new Media
(file.toURI().toString()).getMetadata();
System.out.println(metadata.size());
for (String s : metadata.keySet()) {
System.out.println(s);
}
}
In the method, I receive some music files, which I already prooved to
work, I mean, I can get a MediaPlayer to play them. But what about the
metadata? All I get printed is 0's for the metadata.size() statement.