View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default MP3 ID3 API Calls for excel

Maybe my arithmetic is off, but for 3 + 90 + 4 + 28 + 2, I get 127 rather than
128. Maybe that is the problem -- off by 1 byte.


On Sun, 19 Dec 2004 18:58:45 +1300, "Rob van Gelder"
wrote:

I don't know a lot about MP3 tags except that they occupy the last 128 bytes
of an mp3.

I did some Google searching and found the offsets. It seems to work.

Type MP3Tag
ID As String * 3
Title As String * 30
Artist As String * 30
Album As String * 30
Year As String * 4
Comment As String * 28
ID3Tag As Byte
TrackNumber As Byte
End Type

Sub test()
Const cRecordLen = 128
Dim strFile As String, lngFileLen As Long
Dim tag As MP3Tag, intFF As Integer

strFile = "C:\MP3\Prodigy - Always Outnumbered Never Outgunned\06 -
Prodigy - Wake Up Call.mp3"
lngFileLen = FileLen(strFile)

intFF = FreeFile
Open strFile For Binary Access Read As intFF

Get intFF, lngFileLen - cRecordLen + 1, tag

If tag.ID = "TAG" Then
Debug.Print tag.Album; Tab; tag.TrackNumber; Tab; tag.Title
End If

Close intFF
End Sub