Public Structure IDTagv11
Dim Identifier As String ' 0 3 "TAG" identifier string.
Dim Title As String ' 3 30 Song title string.
Dim Artist As String ' 33 30 Artist string.
Dim Album As String ' 63 30 Album string.
Dim Year As String ' 93 4 Year string.
Dim Comment As String ' 97 28 Comment string.
Dim ZBS As Byte ' 125 1 Zero byte separator.
Dim Track As Byte ' 126 1 Track byte.
Dim Genre As Byte ' 127 1 Genre byte.
End Structure
Dim fs As New System.IO.FileStream(File, IO.FileMode.Open)
Dim Tag(127) As Byte, idv As New IDTagv11
Dim enc As New System.Text.ASCIIEncoding
fs.Position = fi.Size - 128
fs.Read(Tag, 0, Tag.Length)
fs.Close()
If enc.GetString(Tag, 0, 3) = "TAG" Then
idv.Identifier = enc.GetString(Tag, 0, 3) ' 0 3 "TAG" identifier string.
idv.Title = enc.GetString(Tag, 3, 30).Trim ' 3 30 Song title string.
If idv.Title.EndsWith(Chr(0)) Then idv.Title = idv.Title.Substring(0, idv.Title.IndexOf(Chr(0)))
idv.Artist = enc.GetString(Tag, 33, 30).Trim ' 33 30 Artist string.
If idv.Artist.EndsWith(Chr(0)) Then idv.Artist = idv.Artist.Substring(0, idv.Artist.IndexOf(Chr(0)))
idv.Album = enc.GetString(Tag, 63, 30).Trim ' 63 30 Album string.
If idv.Album.EndsWith(Chr(0)) Then idv.Album = idv.Album.Substring(0, idv.Album.IndexOf(Chr(0)))
idv.Year = enc.GetString(Tag, 93, 4) ' 93 4 Year string.
If idv.Year.EndsWith(Chr(0)) Then idv.Year = idv.Year.Substring(0, idv.Year.IndexOf(Chr(0)))
idv.Comment = enc.GetString(Tag, 97, 28).Trim ' 97 28 Comment string.
If idv.Comment.EndsWith(Chr(0)) Then idv.Comment = idv.Comment.Substring(0, idv.Comment.IndexOf(Chr(0)))
idv.ZBS = Tag(125) ' 125 1 Zero byte separator.
idv.Track = Tag(126) ' 126 1 Track byte.
idv.Genre = Tag(127) ' 127 1 Genre byte.
End If