|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
|
I'm working with visual basic 6.0, as the title says. I'll post the code i have right now and then explain whats going on.
Public Type Id3Tag Header As String * 3 SongTitle As String * 30 Artist As String * 30 Album As String * 30 Year As String * 4 Comment As String * 30 Genre As Byte End Type Public Sub GetInfo(FileName As String, Id3Tag As Id3Tag) Dim Id3TagTemp As Id3Tag Dim FileNum As Integer If FileName = "" Then MsgBox "Please Select a File" Exit Sub End If FileNum = FreeFile Open FileName For Binary As FileNum With Id3TagTemp Get FileNum, FileLen(FileName) - 127, .Header Id3Tag.Header = Trim(.Header) Get FileNum, FileLen(FileName) - 124, .SongTitle Id3Tag.SongTitle = Trim(.SongTitle) Get FileNum, FileLen(FileName) - 94, .Artist Id3Tag.Artist = Trim(.Artist) Get FileNum, FileLen(FileName) - 64, .Album Id3Tag.Album = Trim(.Album) Get FileNum, FileLen(FileName) - 34, .Year Id3Tag.Year = Trim(.Year) Get FileNum, FileLen(FileName) - 30, .Comment Id3Tag.Comment = Trim(.Comment) Get FileNum, FileLen(FileName) - 1, .Genre Id3Tag.Genre = Trim(.Genre) End With Close FileNum End Sub This code is located in a Module. At the top i've declared a type Id3 tag. Then i have a sub procedure that is GetInfo which takes two parameters and that is a path of a file selected in a filelist box located on another form and a variable of type Id3Tag. Now i've found samples of code on the net and thats where most of this came from. I've changed it to what i need however. The problem i'm having now is that i can get the information from some mp3s but not others. Most specifically i can't get the id3 tag info from all the songs i ripped from cd's using iTunes. I downloaded some mp3's from www.purevolume.com and they work perfect. I get all the tag information from those, but not the ones ripped using iTunes. I've purchased a few songs from iTunes itself and I can get the tag information from those. I'm not sure whats wrong. Is there a difference in the way Id3v1 tags are set up vs. Id3v2 tags are set up? How can i tell the version of the Id3 tag that is used by an mp3? What programs are out there already that i could use to rip the music from my cds? I could use Windows Media Player but mine seems to be broken, it says it can't find a connection to the interent even tho i have dsl and it's connected all the time. So any help or ideas would be appreciated. If you need to know more, just ask and i'll try and help as much as possible. Thanks in advance! EDIT: Spelling EDIT: I did some looking in iTunes and the id3 tag version that the mp3s extracted with that are v2.2. So now my question is whats the difference in how v1 tags are set up vs. v2 tags are set up? Last edited by 04nmr85; 05-10-2005 at 12:24 PM. |
|
|
|
|
|
#2 |
|
Professional gadfly
|
What I would do is simply open the MP3 files in a hex editor to figure out the difference between the two ID3 tag formats.
For ripping, I use Exact Audio Copy. |
|
|
|
|
|
#3 |
|
Member (8 bit)
|
Using a hex editor might be a little to advanced for me, i'm not sure tho. I've never done it before. I'm only a novice programmer, in my 3 quarter i believe at ITT Tech. How would I use a Hex editor to figure out the difference? Maybe you could point me to some information if you don't feel like explaining it. I'll go google it in the meanwhile.
|
|
|
|
|
|
#4 |
|
Professional gadfly
|
A hex editor just shows the file in binary form. You obviously know enough about the file format to figure out where the ID3 tag information is stored, since that information is in the code (the 127, 124, 94 numbers are byte offsets to the information in the tag, stored at the end of the file).
Just quickly looking at an MP3 file I have, it appears that ID3v2 tags are stored at the beginning of the file, while v1 tags are at the end, so you are going to need completely different code for them. |
|
|
|
|
|
#5 |
|
Member (8 bit)
|
Hmm, it does look like it's stored at the beginning of the file. Thats kind of interesting. I guess all i have to do now is figure out where everything is located. Thanks Doc
|
|
|
|
|
|
#6 |
|
Member (8 bit)
|
Oh and I found a hex editor on the net that i'm using now to look at the mp3 files. I found it here at this site http://www.softcircuits.com/cygnus/. I'm looking and i see all these numbers and i'm wondering what all of them mean. I believe the right-most column are the byte values, the middle column the hex values and then the right colum ascii values. My understanding of these values is very limited, maybe you could help me understand them a little better?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|