Hi Eric,
Bart has given this once to the newsgroups, I do not know if it works.
Cor
\\\By Bart Verdonck
(comments where in dutch, translated a little bit by Cor)
Private Sub MP3InfoOphalen()
Try
' Open a FileStream openen, binded to the file
Dim strMP3 As New IO.FileStream(Me.BestandsNaam, _
IO.FileMode.Open, IO.FileAccess.Read)
'Use a BinaryReader to read binary the characters from the FileStream
Dim binReader As New IO.BinaryReader(strMP3)
' When they are present is it in the MP3-informatie 127 bytes before the
end of the file
binReader.BaseStream.Seek(-128, IO.SeekOrigin.End)
' Only if the first 3 bytes on that position makes the word TAG, than
'contains the file real MP3-information, which we can get from it
If binReader.ReadChars(3) = "TAG" Then
msTitel = binReader.ReadChars(30)
' We read 30 characters for the tittle
msArtiest = binReader.ReadChars(30)
' We read 30 characters for the artist
msAlbum = binReader.ReadChars(30)
' We read 30 characters for the album
msJaar = binReader.ReadChars(4)
' We read 4 characters for the year
msCommentaar = binReader.ReadChars(30)
' We read 30 characters for comment
Else
' No real MP3-bestand: clean the fields
msTitel = ""
msArtiest = ""
msAlbum = ""
msJaar = ""
msCommentaar = ""
End If
' Close the BinaryReader and FileStream
binReader.Close()
strMP3.Close()
Catch ex As IO.IOException
msTitel = ""
msArtiest = ""
msAlbum = ""
msJaar = ""
msCommentaar = ""
End Try
End Sub