Cause:
Today, I got a requriement that get ID3 info from MP3 and M4A files.
I am good on MP3 knowledge, but I don’t familiar on M4A format so far.
Solution:
First of all, I google it, and then I got answer so quickly.
I found a lib can help me to get them.
Codes:
Let’s see code directly:
- Get track playing duration:
1 | AudioFile f = AudioFileIO.read(musicFile); |
It just so simple.
- Get ID3 info:
1 | AudioFile f = AudioFileIO.read(file); |
For more properties, you cloud refer FieldKey class.