by Darren J. Prior (1 Submission)
Category: Sound/MP3
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (6 Votes)
Calculates the duration in seconds of a .mp3 file. Also displays the
associated layer, bitrate, sample rate of the file.
I've bundled the function into a project to display how it should be called.
This function does not read id3 tags. Search Visual Basic World for 'id3 tag'
Much thanks to Predrag Supurovic's page on MPEG frame headers
(https://www.dv.co.yu/mpgscript/mpeghdr.htm)
Inputs
the full filename of a .mp3 file. eg: d:\artist\album\track1.mp3
The function does not perform any error checking so will fail if it is not a
valid mp3 file.
Assumes
read the web page mentioned earlier for more info on mp3 frames.
Code Returns
see inside the function for the mp3_ variables that are generated.
Side Effects
no error checking of file
Download GetMP3data (3 KB)