Is there a way to get the Audio file properties of an mp3 audio file ? I am mainly looking for the bit rate and the total time. These are in the properties of the file but not in the ID3 tag V1 or V2
#AdditionalJar: mp3agic-0.9.1
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Log("Hello world!!!")
Dim mp3 As JavaObject = LoadMp3File("D:\Documents\Music\222.mp3")
Log(mp3.RunMethod("getBitrate", Null))
Log(mp3.RunMethod("getSampleRate", Null))
Log(mp3.RunMethod("getLengthInMilliseconds", Null))
End Sub
Private Sub LoadMp3File (Path As String) As JavaObject
Dim jo As JavaObject
jo.InitializeNewInstance("com.mpatric.mp3agic.Mp3File", Array(Path))
Return jo
End Sub
#AdditionalJar: mp3agic-0.9.1
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Log("Hello world!!!")
Dim mp3 As JavaObject = LoadMp3File("D:\Documents\Music\222.mp3")
Log(mp3.RunMethod("getBitrate", Null))
Log(mp3.RunMethod("getSampleRate", Null))
Log(mp3.RunMethod("getLengthInMilliseconds", Null))
End Sub
Private Sub LoadMp3File (Path As String) As JavaObject
Dim jo As JavaObject
jo.InitializeNewInstance("com.mpatric.mp3agic.Mp3File", Array(Path))
Return jo
End Sub
By reading the detailed description of the library, I found that it was possible also to get the frames of the MP3 track
Getting ID3v2 frame values
Convenience methods are included to easily get common ID3v2 frames. If you wish to get frame data that does not have convenience methods, or if you wish to access meta-data on frames, direct reading of frames is possible (see further down on this page).
Mp3File mp3file = new Mp3File("SomeMp3File.mp3");
if (mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
System.out.println("Track: " + id3v2Tag.getTrack());
Final target is to get the parameters from the ID (name, year, album....)
In the sample joined to the library, the author gets them by getting :
- firstly, id3v2Tag = mp3file.getId3v2Tag();
- secondly, the parameter from this tag = id3v2Tag.getTrack());
I tried to reproduce that by calling Erel's subroutine with "getTrack" as parameter.
As I said, it was a try ! I do not know Java world