Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MP3 ID3 API Calls for excel

I am trying to setup a sheet that has filenames, ID3 info fr all my MP3's.
Does anyone know of a site that can provide API info for ID3 tags? or a way
to get the info into excel?

Thanks
Chad


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default MP3 ID3 API Calls for excel

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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chad Cameron" wrote in message
...
I am trying to setup a sheet that has filenames, ID3 info fr all my MP3's.
Does anyone know of a site that can provide API info for ID3 tags? or a
way to get the info into excel?

Thanks
Chad



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MP3 ID3 API Calls for excel

Perfect, that is exactly what I need.

Now the next step is once I have all the info listed in columns, how do I
update the file if I change some of the data? Well, I know how to change
it, what is the command to save the .mp3?

TIA,
Greatly appreciated
Chad


"Rob van Gelder" wrote in message
...
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chad Cameron" wrote in message
...
I am trying to setup a sheet that has filenames, ID3 info fr all my MP3's.
Does anyone know of a site that can provide API info for ID3 tags? or a
way to get the info into excel?

Thanks
Chad





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default MP3 ID3 API Calls for excel

http://www.vb-fun.de/cgi-bin/loadfra.../tip0106.shtml

(in German but you shouldn't have any problem...)

Tim.


"Chad Cameron" wrote in message
...
Perfect, that is exactly what I need.

Now the next step is once I have all the info listed in columns, how
do I update the file if I change some of the data? Well, I know how
to change it, what is the command to save the .mp3?

TIA,
Greatly appreciated
Chad


"Rob van Gelder" wrote in
message ...
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chad Cameron" wrote in message
...
I am trying to setup a sheet that has filenames, ID3 info fr all my
MP3's. Does anyone know of a site that can provide API info for ID3
tags? or a way to get the info into excel?

Thanks
Chad







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default MP3 ID3 API Calls for excel

Hi

I have a freeware mp3 tagwriter OCX that I found that was written for vb5,
but it works great in VBA. Just drop it on a worksheet oer a user .
If you email me, I will send it and a working example workbook to you.

HTH

Ken




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MP3 ID3 API Calls for excel

I looked at the link. I used a chunk of the code, but the mp3 file doesn't
update the id3 info. When I step through it appears to work, but when I
open the mp3 the id3 info is the same.
Here is the code:

Sub xWrite()
strFile = Cells(2, 1) 'Filename of mp3
lngFileLen = FileLen(strFile)
intFF = FreeFile
Open strFile For Binary Access Write As intFF
tag.Title = ActiveCell.Offset(0, 3)
tag.Artist = ActiveCell.Offset(0, 4)
tag.Album = ActiveCell.Offset(0, 5)
tag.Year = ActiveCell.Offset(0, 6)
tag.Comment = ActiveCell.Offset(0, 7)
tag.TrackNumber = ActiveCell.Offset(0, 8)
Put intFF, lngFileLen - cRecordLen + 1, tag
Debug.Print tag.Title; 'check if the info is updated
Close intFF
End Sub



"Tim Williams" <saxifrax@pacbell*dot*net wrote in message
...
http://www.vb-fun.de/cgi-bin/loadfra.../tip0106.shtml

(in German but you shouldn't have any problem...)

Tim.


"Chad Cameron" wrote in message
...
Perfect, that is exactly what I need.

Now the next step is once I have all the info listed in columns, how do I
update the file if I change some of the data? Well, I know how to change
it, what is the command to save the .mp3?

TIA,
Greatly appreciated
Chad


"Rob van Gelder" wrote in message
...
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chad Cameron" wrote in message
...
I am trying to setup a sheet that has filenames, ID3 info fr all my
MP3's. Does anyone know of a site that can provide API info for ID3
tags? or a way to get the info into excel?

Thanks
Chad









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MP3 ID3 API Calls for excel

I am wrong, it is not updating the file, it is deleting all the id3 info.
I will have to look deeper into my code.


  #8   Report Post  
Posted to microsoft.public.excel.programming
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


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default MP3 ID3 API Calls for excel

You seem to have left out some critical parts of the code example you were
given.

I don't see where you are (1) defining the structure of the user-defined type
variable, (2) dimensioning the variable tag as that UDT, or (3) setting a
value for cRecordLen. But also see my other post re the length of the tab
record.

On Sun, 19 Dec 2004 13:22:13 -0800, "Chad Cameron" wrote:

I looked at the link. I used a chunk of the code, but the mp3 file doesn't
update the id3 info. When I step through it appears to work, but when I
open the mp3 the id3 info is the same.
Here is the code:

Sub xWrite()
strFile = Cells(2, 1) 'Filename of mp3
lngFileLen = FileLen(strFile)
intFF = FreeFile
Open strFile For Binary Access Write As intFF
tag.Title = ActiveCell.Offset(0, 3)
tag.Artist = ActiveCell.Offset(0, 4)
tag.Album = ActiveCell.Offset(0, 5)
tag.Year = ActiveCell.Offset(0, 6)
tag.Comment = ActiveCell.Offset(0, 7)
tag.TrackNumber = ActiveCell.Offset(0, 8)
Put intFF, lngFileLen - cRecordLen + 1, tag
Debug.Print tag.Title; 'check if the info is updated
Close intFF
End Sub



"Tim Williams" <saxifrax@pacbell*dot*net wrote in message
...
http://www.vb-fun.de/cgi-bin/loadfra.../tip0106.shtml

(in German but you shouldn't have any problem...)

Tim.


"Chad Cameron" wrote in message
...
Perfect, that is exactly what I need.

Now the next step is once I have all the info listed in columns, how do I
update the file if I change some of the data? Well, I know how to change
it, what is the command to save the .mp3?

TIA,
Greatly appreciated
Chad


"Rob van Gelder" wrote in message
...
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chad Cameron" wrote in message
...
I am trying to setup a sheet that has filenames, ID3 info fr all my
MP3's. Does anyone know of a site that can provide API info for ID3
tags? or a way to get the info into excel?

Thanks
Chad









  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MP3 ID3 API Calls for excel

Thanks for the reply, All the variable definisions are global and not
shown. I got 127 too, but I assumed that if you start at 1 and go to 128
there are only 127 numbers in between, but that could be a problem.


"Myrna Larson" wrote in message
...
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






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default MP3 ID3 API Calls for excel

Hi Myrna.

I discovered the 127 too, which is why I start reading 127 from the end of
the file - even though I said it was 128 from the end of the file.
- cRecordLen + 1

I've never read the API for mpeg so I'm not 100% sure of the structure. I
assumed the OP was after a quick'n'dirty dump util.

Cheers

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Myrna Larson" wrote in message
...
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




  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default MP3 ID3 API Calls for excel

Thanks for everyones help. I figured out my problem. I forgot to set .ID
to "TAG"

Chad


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I make Phone Calls directly from Excel or Outlook? Stuart S. Excel Discussion (Misc queries) 0 February 5th 09 09:13 PM
excel calls a worksheet that has initial row consisting of labels chava New Users to Excel 2 September 4th 07 08:07 PM
Excel calls for Save ~Bolesław Cienki Excel Discussion (Misc queries) 2 August 25th 06 05:21 PM
excel vba problem - function calls from cells internerdj Excel Programming 6 July 7th 04 10:18 PM
Converting Access dll calls to Excel program Pal Excel Programming 1 February 1st 04 04:52 PM


All times are GMT +1. The time now is 05:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"