PDA

Click to See Complete Forum and Search --> : ID3v1 tag reader for MP3 files


penagate
Dec 25th, 2005, 11:20 AM
Adapted from Steve Mac's VB6 code here (http://www.vbaccelerator.com/home/VB/Code/vbMedia/Audio/Reading_and_Writing_MP3_ID3v1_and_v2_Tags/article.asp).

Supports versions 1.0-1.1 of the tag spec. ID3v2 to follow.

To use, just declare a new instance and pass the mp3 filename in the constructor.

ID3v1tag tag = new ID3v1tag(@"D:\Music\Some track with an ID3v1 tag.mp3");


Comments welcome (especially suggestions of replacements for the huge switch() block :))

tony007
Apr 26th, 2006, 10:47 PM
Does it read id tag for remote mp3?

penagate
Apr 26th, 2006, 11:22 PM
Not without downloading it first as it uses a Streamreader.

tony007
Apr 26th, 2006, 11:26 PM
dam i am looking for one to read remote id3 tags. There is a site that has that option but they do not provide the source code which is php!!

penagate
Apr 27th, 2006, 06:19 AM
What you could download is download the mp3 file in bits, looking for an ID3 header section in those bits, and if you get a complete ID3 header, stop the download and feed what you have into the tag reader class. Shouldn't be too hard to adapt it to use a buffer (stream object perhaps?) rather than a local file. There are a lot of classes you can use to achieve the downloading, look in the System.Web and System.Net namespaces.

francisstokes
Apr 27th, 2006, 07:16 PM
Thats cool :D

tony007
Apr 28th, 2006, 06:20 AM
What you could download is download the mp3 file in bits, looking for an ID3 header section in those bits, and if you get a complete ID3 header, stop the download and feed what you have into the tag reader class. Shouldn't be too hard to adapt it to use a buffer (stream object perhaps?) rather than a local file. There are a lot of classes you can use to achieve the downloading, look in the System.Web and System.Net namespaces.

Thank u for u reply. Could u show me how i can download mp3 by bits and look for its id3 header? I never dealt with bits:-(