views:

82

answers:

1

I'm trying to figure out how to read the "ratings" from an AAC file on Windows 7. This data is somehow persisted in the file as the Windows 7 shell and WMP can read / write the ratings.

In MP3 the ratings data is stored in the PopularimeterFrame of the Id3v2 but AAC does not use Id3v2 tags.

Does anyone happen to know how to get at this info?

I'm using TagLib# to read meta data btw.

+1  A: 

Figured this out.

Prerequisites: Windows API Code Pack

static void WriteAACData(FileInfo file, int rating, int playcount)
{
    ShellFile so = ShellFile.FromFilePath(file.FullName);
    uint fileRating = (uint)so.Properties.System.Rating.Value;
    System.Diagnostics.Trace.WriteLine(String.Format("Rating: {0}", fileRating));
    so.Properties.System.Rating.Value = (uint)rating;
}
Omar Shahine