MP3GetInfo

Returning information on an MP3 file.
Returns a type containing information about an MP3 file
By: Andrew Baker

CodeFunctionName
What is this?

Public

Not Tested

Imported
Public Type MP3Info
Tag As String * 3
Songname As String * 30
Artist As String * 30
Album As String * 30
Year As String * 4
Comment As String * 30
Genre As String * 1
End Type
Function MP3GetInfo(sFileName) As MP3Info
Dim sTemp As String, iFreeFile As Integer
On Error GoTo ErrFailed
iFreeFile = FreeFile
Open sFileName For Binary As iFreeFile
With MP3GetInfo
Get #1, FileLen(sFileName) - 127, .Tag
If Not .Tag = "TAG" Then
Debug.Print "No tag for " & sFileName
Else
Get #1, , .Songname
Get #1, , .Artist
Get #1, , .Album
Get #1, , .Year
Get #1, , .Comment
Get #1, , .Genre
End If
End With
Close iFreeFile
Exit Function
ErrFailed:
Debug.Print "Error in MP3GetInfo: " & Err.Description
Close iFreeFile
End Function

sFileName

Views 4,978

Downloads 1,465

CodeID
DB ID

ANmarAmdeen
606
Revisions

v1.0

Wednesday
July
11
2018