how to extract metadata from documents of a filesystem

Hi, how can I extract metadata like author, album, singer, size , etc. metadata
from files(such as mp3, doc, pdf, jpeg...), are there any API(SDK) ?
thanks
[163 byte] By [GavinWang] at [2007-11-19 7:31:26]
# 1 Re: how to extract metadata from documents of a filesystem
You get this information from either the Windows Media SDK (that comes with windows media player 8 and above) or from the real libraries for the file formats. LIke libpng, libjpeg etc.
NoHero at 2007-11-9 13:15:13 >
# 2 Re: how to extract metadata from documents of a filesystem
Or you can write your own. MP3 tags are stored at the end of the file structure, for example, and can easily be extracted (though there are a couple of different specifications out now, depending on how many tags it's using: ID3v1, ID3v2). Nevertheless, this can be as easy as reading the file and picking out the info you need.

For example, the ID3v1 tags always start with the word "TAG" so you can easily determine where the information begins within the file. A struct may help you store this info:

struct MP3TAG
{
TCHAR szTag[3]; // Always the string "TAG"
TCHAR szTitle[30];
TCHAR szArtist[30];
TCHAR szAlbum[30];
TCHAR szYear[4];
TCHAR szComment[30];
BYTE byGenre;
};

As you can see, the entire tag struct is 128 bytes.
Bond at 2007-11-9 13:16:11 >