how can I read MP3-Tags 
Author Message
 how can I read MP3-Tags

Hi everyone !

Does anyone know how to read the TAGs from a MP3 File ?
Can anyone send me a little sourcecode ???

Thanx !

Sun, 03 Jun 2001 03:00:00 GMT  
 how can I read MP3-Tags
Hi Boris,

    Here you go:

        Note-    to see how to get the genre, you need to take the hex
                  value and do a look up. To see a good listing of genres
                    check out the link shown in the code.

            Best of luck, Mark
ICQ 22542142

Option Explicit
' Based on code found in "Mp3Organizer" by Georges Kanaan
' found at
Private Type MP3Info
    ' MPEG-Info
      ' ID3-Tag info (the last 128 bytes of the file)
    Tag As String * 3 ' if Tag = "TAG" then it exists
    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

Private Sub Command1_Click()
Dim f%
Dim pos As Long
Dim mp3i As MP3Info
Dim myFile As Variant
Dim FileSize As Long
Dim SongName As String * 30
Dim Artist As String * 30
Dim Album As String * 30
Dim Year As String * 4
Dim Comment As String * 30
Dim Genre As String * 1

   ' Get a free file handle to avoid using a file handle already in use
   f% = FreeFile

myFile = "c:/alienMp3/incmp3/(les_miserable)_04-i_dreamed_a_dream_.mp3"

Open myFile For Binary As f%
FileSize = LOF(f%)
    'Seek ahead to 128 bytes from EOF
pos = FileSize - 127
Seek f%, pos
 Get f%, , mp3i
 Tag = mp3i.Tag
 Debug.Print Tag
 If Tag = "TAG" Then
  SongName = LTrim(mp3i.SongName)
 Artist = LTrim(mp3i.Artist)
 Album = LTrim(mp3i.Album)
 Year = LTrim(mp3i.Year)
 Comment = LTrim(mp3i.Comment)
 Genre = mp3i.Genre
    Debug.Print "no tag found"
 End If
 Debug.Print SongName; Artist; Album; Year
end sub


>Hi everyone !

>Does anyone know how to read the TAGs from a MP3 File ?
>Can anyone send me a little sourcecode ???

>Thanx !

Sun, 03 Jun 2001 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. How to read mp3 ID3v1 Tag and other properties in ACCESS VBA

2. Read & write mp3 ID3v2 Tags

3. Read MP3 Tag informations via VB.NET?

4. Read/Write MP3 Info Tags

5. Reading MP3 ID3 Tag

6. Help Reading ID3 Tag Information from MP3 file

7. import information from MP3-tag to acces DB

8. MP3 ID Tags

9. MP3 Tag Information

10. MP3 playing and editting tag info

11. Need an Easy MP3 ID3-tag editor ??

12. Mp3 id3 tags


Powered by phpBB® Forum Software