1

WM/MediaClassPrimaryID具体的には、WM/MediaClassSecondaryID、フレームなどの Windows Media Player フレームを書きたいと思いWM/WMCollectionGroupIDます。

私は PowerShell を使用していますが、C# も良いでしょう。

4

1 に答える 1

3

私は少しさびていますが、以下はほとんど正しいはずです。これらのタグは UTF-16 だったことを覚えていますが、おそらく既存のタグを取得して、その値を Unicode エンコーダーでデコードしてみてください。

// Get or create the ID3v2 tag.
TagLib.Id3v2.Tag id3v2_tag = file.GetTag(TagLib.TagTypes.Id3v2, true);

if(id3v2_tag != null) {
    // Get the private frame, create if necessary.
    PrivateFrame frame = PrivateFrame.Get(id3v2_tag, "WM/MediaClassPrimaryID", true);

    // Set the frame data to your value.  I am 90% sure that these are encoded with UTF-16.
    frame.PrivateData = System.Text.Encoding.Unicode.GetBytes(value);
}
于 2012-01-16T20:51:42.987 に答える