Jump to content

Reading a file's ID3 tags


crelf

Recommended Posts

From wikipedia:

QUOTE

ID3 is a metadata container most often used in conjunction with the MP3 audio file format. It allows information such as the title, artist, album, track number, or other information about the file to be stored in the file itself.

Does anyone know how to read a file's ID3 tag? I'm not interested in editing the tags, just reading them. For example, I'd like to scan a folder for all the mp3 files and compile a list of, say, artists.

Here's some more info on ID3 from wikipedia and the ID3 foundation.

Link to comment

QUOTE(tcplomp @ Mar 10 2007, 09:22 AM)

What is this homework????

Actually, yes it is :) I'm backing up my iPod, and when copying files from it (it's mounted as an external drive) they're all named xxxx.mp3 (where x = aplha character) and I'd like to rename them something human-friendly like ArtistName_AlbumName_TrackNumber_TrackName.mp3

Link to comment

QUOTE(Michael_Aivaliotis @ Mar 10 2007, 12:30 PM)

I'm not sure what you want here. Itunes does all this for you already, and on top of that it puts all you rmusic in logical folders.

Not on my old old old iPod - it's all in folders called F00, F01, F02... and they're named in seemingly quasi-randomly named four letter files.

Link to comment

QUOTE(tcplomp @ Mar 10 2007, 08:13 PM)

At least ID3 v1 tags are quite easy http://sine.ni.com/niforum/niforum?forumDU=http://forums.ni.com/ni/board/message?board.id=170&message.id=124924&requireLogin=False' target="_blank">according to tst (dark side alert)

QUOTE

An ID3 tag is just the last 128 bytes of a file and most of it is plain ASCII, so you can read that using Read File and then change it and write back

That's interesting - very interesting. 128 bytes isn't a whole lot of room to jam in artist, album, title, track number, etc, although I s'pose it was only version 1...

Link to comment

QUOTE(crelf @ Mar 10 2007, 12:32 AM)

Actually, yes it is :) I'm backing up my iPod, and when copying files from it (it's mounted as an external drive) they're all named xxxx.mp3 (where x = aplha character) and I'd like to rename them something human-friendly like ArtistName_AlbumName_TrackNumber_TrackName.mp3

I did this a couple of years ago (in C using id3lib) for exactly the same reason...

If you consider reading MP3 headers yourself, take a look at the id3lib code :o - it's quite convulted...

-Mikkel

Link to comment

QUOTE(Mikkel @ Mar 11 2007, 02:54 PM)

I've done this in other languages as well, but I've honestly thought that having an MP3 library in LabVIEW might prove useful. Especially since going back to Perl or PHP for me would be similar to a Lexus owner getting back into his rusty 1970 http://www.youtube.com/watch?v=1Sn9L94YrNk' target="_blank">Toyota Hilux from High School... (bugger)

For instance, I have a library of MP3s that are added to weekly (for my church) on a web site. We need to get a podcast going so that people can set their iPods to download the updates automatically. Well, there are about 9.5Gb of MP3s that need to be tagged since no one there knew about tagging when they started the process years ago on audio cassette...

Would the tool mentioned (Tagscanner) be suitable for this? What about something else that is automated to tag and update an RSS XML file as MP3 files are dropped into the website? It seemed like I could do this in LV, but I haven't tried yet.

Link to comment

QUOTE(orko @ Mar 12 2007, 06:15 AM)

Would the tool mentioned (Tagscanner) be suitable for this?

Most likely: Yes.

Tagscanner can create tags based on directory structure/filename and create a directory structure/filename based on tags.

What I normally do is check the tags, update them from the directory structure if needed, and then apply my own directory structure based on the tags.

Ton

Link to comment

QUOTE(Mikkel @ Mar 16 2007, 02:39 PM)

I've made a few interface VIs for the ID3LIB dll, which should make it possible to extract basic information from ID3 headers.

Wow! Thanks Mikkel! :thumbup: That's what I like about these forums, if you research and ask the right questions, there is bound to be someone that can help you out! :book:

I'll take a look at these next week!!

PS. Hey!!! This is my 100th post!

Link to comment

QUOTE(orko @ Mar 17 2007, 11:30 PM)

Wow! Thanks Mikkel! :thumbup: That's what I like about these forums, if you research and ask the right questions, there is bound to be someone that can help you out! :book:

I'll take a look at these next week!!

PS. Hey!!! This is my 100th post!

It's nice to hear, that you can use this for something ;)

I mostly made it as an experiment to see if I could get ID3Lib to work with LabVIEW...

I've updated the download, as the original one had a memory leak in the demo vi (if you make a new tag, you better delete it afterwards, else you are leaking tags).

Congrats on your hecto-post!

-Mikkel :)

Link to comment
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.