Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

atten PHV re some old code posted re MP3 tags

Status
Not open for further replies.

JamesBBB

Technical User
Nov 2, 2005
74
0
0
GB
Hi PHV, I hope this post reashes you.

SOme time ago you posted a solution to reading MP3tags from within VBA, the code being

You may try something like this :

Dim sTagIdent As String * 3
Dim sTitle As String * 30
Dim sArtist As String * 30
Dim sAlbum As String * 30
Dim sYear As String * 4
Dim sComment As String * 30
Open "\path\to\file.mp3" For Binary As #1
Seek #1, LOF(1) - 127
Get #1, , sTagIdent
If sTagIdent = "TAG" Then
Get #1, , sTitle
Get #1, , sArtist
Get #1, , sAlbum
Get #1, , sYear
Get #1, , sComment
End If
Close #1

I have tried but had no success, to read the rest of the tags as follow:-

track
Album artist
Genre
length
Size
Bitrate
Mode
Samplerate

Is there a way this can be done, any help would be very gratefully received as I am totally lost on this one.

many thanks

James

 
Hmm, best I can find is at the moment, not been able to test it due to lack of mp3 files at work [sad]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I'm going to sound daft now, but you've lost me there Remou...[ponder]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
It is possible to get a lot of information about files using Windows Desktop Search. WDS can be scripted, which translates easily to VBA, as I am sure you know. A little more info:

How Can I Find All the Files in a Directory Tree that Contain a Specific Word or Phrase?Windows Desktop Search 3.0 Properties

WDS chews up resources, so it is possible that the OP would not wish to use it, however, it seems to be the next thing as it installs with Office 2007.
 
Remou, very nice (have something purple and pointy). I got that it could be scripted but hadn't bargained (or seen in the documentation) that it could return that much info about the files it was finding.

Plus the fact that it uses ADO make the whole thing pretty simple to work with [smile]

I remember having an earlier version of WDS on a machine at my previous work and unless it's changed dramatically I can second your comment about it chewing up resources!

Cheers

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks Guys the help is invaluable, I will research and test and let you know how I get on

Many thanks

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top