how to get the metadata information for audio and image files?
Hi,
I am developing an application part of which would display information about audio and image files. The information would primarily be the metadata information of the files. For example, for an audio file, the information would be the artist, album, author, category, length of the track, bitrate etc., which form the metadata of the file.
The information for the image files would be the height & width of the image, whether the image is colored etc.,
I am sure there would be some API / library in windows that could give all these information. It would be nice if anyone of you can help me out in knowing what the API/library is, if any.
If there is no windows API / library, is there any third party library that is simple to give only these information?
I m in an urgency to know, as my project is held due to this. Kindly help me out.
Thanks in Advance
Karthik
Hi Karthik,
If you're trying to do this through the Media Foundation platform (the new multimedia platform for Windows Vista, which this forum is about), then that'll work for the types of media supported by Media Foundation -- i.e. ASF/WMV/WMA and MP3 files. You'll need to create an IMFMediaSource and then use IMFMetadataProvider to get the IMFMetadata interface, which you should be able to use to read metadata attributes like the ones you're interested in. The MSDN docs will give you the details on how to do this.
Now, that works for Vista only. I'm guessing that you are trying to do this on older OS versions as well. If so, your best bet is to try the newsgroups: http://msdn.microsoft.com/newsgroups/topic.aspx?url=/msdn-files/028/201/070/topic.xml. For instance, one thing that will work for media files of the type I mentioned above is the Windows Media Format SDK's IWMHeaderInfo APIs. Again, check out the MSDN docs for details.
Becky