# VBForums CodeBank > CodeBank - C# >  ID3v1 tag reader for MP3 files

## penagate

Adapted from Steve Mac's VB6 code here.

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  :Smilie: )

----------


## tony007

Does it read id tag for remote mp3?

----------


## penagate

Not without downloading it first as it uses a Streamreader.

----------


## tony007

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

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

Thats cool  :Big Grin:

----------


## tony007

> 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:-(

----------

