![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I would like to create a music database using the information in the MP3 ID3 tags (v1 and v2). Is it possible to capture those tags and spread them in different fields in an Access database (or Excel for that matter), for adding, modifying, indexing, retrieving, etc. TIA Gilles |
#3
| |||
| |||
|
|
Certainly - you need to read the file specification for details on where these fields are stored in the file (google search for MP3 File Format Specification), i think for MP3 thats at the end of the file. Then you need to open the file forReading, binary, and set your cursor to those locations and read the data in vba, then poke it into your fields. if you need more help then that holler, John |
|
jobrien at acscience dot com gilles <gchiase181 (AT) rogers (DOT) com> wrote I would like to create a music database using the information in the MP3 ID3 tags (v1 and v2). Is it possible to capture those tags and spread them in different fields in an Access database (or Excel for that matter), for adding, modifying, indexing, retrieving, etc. TIA Gilles |
#4
| |||
| |||
|
|
John (thanks for your response) I looked at the file specs and see that I may have asked more than I can chew here... Consider this a holler... With a little more details I might be able to get a friend to write a routine for me that I could use in MS Access or Excel. I'm afraid I could not write some code ! That gives me cold sweats... I was hoping just to enter stuff in a database. If you do not have time to respond again, I'll give this to my friend and maybe she could help. She knows Access inside out, but I'm not sure what she knows of ID3s, although she usually surprises me. Gilles On 5 Nov 2003 19:11:43 -0800, jobrienct (AT) excite (DOT) com (John) wrote: Certainly - you need to read the file specification for details on where these fields are stored in the file (google search for MP3 File Format Specification), i think for MP3 thats at the end of the file. Then you need to open the file forReading, binary, and set your cursor to those locations and read the data in vba, then poke it into your fields. if you need more help then that holler, John jobrien at acscience dot com gilles <gchiase181 (AT) rogers (DOT) com> wrote I would like to create a music database using the information in the MP3 ID3 tags (v1 and v2). Is it possible to capture those tags and spread them in different fields in an Access database (or Excel for that matter), for adding, modifying, indexing, retrieving, etc. TIA Gilles |
#5
| |||
| |||
|
|
Ahh, so you just want to read it and type it in manually? (giggle) Well ok, Just open the mp3 with something like the windows media player - doesnt that display the information you need? Apparently, from a quick glance, you want the last 128 bytes of the file for the ID3 tag. If you want to do it programatically... I usually don't do this (unless i'm getting paid for it) but I got interested so heres a routine that reads each value from the ID3 and places the individual fields in a msgbox. you can figure out what to do with them from there with your friend i guess, it's overly commented for your benefit ![]() this procedure is called with: ParseID3("c:\BlueGrass.mp3") Sub ParseID3(pstrFile) 'Field vars Dim strchar As String Dim strTag As String Dim strTitle As String Dim strArtist As String Dim strYear As String Dim strComment As String Dim strGenre As String 'File vars Dim fp As Integer Dim lngFileSize As Long Dim lngTagStart As Long 'fp = filepointer to next free file handle fp = FreeFile() 'open the filename assigning to it the filepointer fp Open pstrFile For Binary As fp 'get filesize lngFileSize = LOF(fp) 'get start of ID3 tag lngTagStart = lngFileSize - 127 'set the cursor to the start of the ID3 tag Seek #fp, lngTagStart 'read the first 3 chars, should be "TAG" For x = 1 To 3 strchar = Input(1, #fp) If strchar <> "" Then strTag = strTag & strchar Next 'Test for properly formatted tag If strTag = "Tag" Then 'If ok then get title (Seek #fp, (lngTagStart + 3)) For x = 1 To 30 strchar = Input(1, #fp) If strchar <> "" Then strTitle = strTitle & strchar Next 'get artist Seek #fp, (lngTagStart + 3 + 30) For x = 1 To 30 strchar = Input(1, #fp) If strchar <> "" Then strArtist = strArtist & strchar Next 'get album Seek #fp, (lngTagStart + 3 + 30 + 30) For x = 1 To 30 strchar = Input(1, #fp) If strchar <> "" Then strAlbum = strAlbum & strchar Next 'get year Seek #fp, (lngTagStart + 3 + 30 + 30 + 30) For x = 1 To 4 strchar = Input(1, #fp) If strchar <> "" Then strYear = strYear & strchar Next 'get comment Seek #fp, (lngTagStart + 3 + 30 + 30 + 4) For x = 1 To 30 strchar = Input(1, #fp) If strchar <> "" Then strComment = strComment & strchar Next ' get genre Seek #fp, (lngTagStart + 3 + 30 + 30 + 4 + 30) strGenre = Input(1, #fp) MsgBox "Tag: " & strTag & "<" MsgBox "Title: " & strTitle & "<" MsgBox "Artist: " & strArtist & "<" MsgBox "Album: " & strAlbum & "<" MsgBox "Year: " & strYear & "<" MsgBox "Comment: " & strComment & "<" MsgBox "Genre: " & Asc(strGenre) & "<" End If Close #fp End Sub John gilles <gchiase181 (AT) rogers (DOT) com> wrote John (thanks for your response) I looked at the file specs and see that I may have asked more than I can chew here... Consider this a holler... With a little more details I might be able to get a friend to write a routine for me that I could use in MS Access or Excel. I'm afraid I could not write some code ! That gives me cold sweats... I was hoping just to enter stuff in a database. If you do not have time to respond again, I'll give this to my friend and maybe she could help. She knows Access inside out, but I'm not sure what she knows of ID3s, although she usually surprises me. Gilles On 5 Nov 2003 19:11:43 -0800, jobrienct (AT) excite (DOT) com (John) wrote: Certainly - you need to read the file specification for details on where these fields are stored in the file (google search for MP3 File Format Specification), i think for MP3 thats at the end of the file. Then you need to open the file forReading, binary, and set your cursor to those locations and read the data in vba, then poke it into your fields. if you need more help then that holler, John jobrien at acscience dot com gilles <gchiase181 (AT) rogers (DOT) com> wrote I would like to create a music database using the information in the MP3 ID3 tags (v1 and v2). Is it possible to capture those tags and spread them in different fields in an Access database (or Excel for that matter), for adding, modifying, indexing, retrieving, etc. TIA Gilles |
![]() |
| Thread Tools | |
| Display Modes | |
| |