Search code examples
powershelltaglibid3taglib-sharp

Reading id3v2 frames with TagLib in Powershell


I'm trying to read a file's id3v2 tag information using the TagLib# library with Powershell. Reading the standard tag properties is not a problem (artist, title etc.), but I'm having difficulty figuring out how to read the ID3v2 frames (specifically the COMMENT).

Can anyone provide a simple example as to how to accomplish this? Documentation on this is scarce it seems.


Solution

  • Figured it out.

    This is what I was trying to accomplish:

    # load the TagLib# assembly into PowerShell
    [Reflection.Assembly]::LoadFrom("C:\taglib-sharp.dll")
    
    $media = [TagLib.MPEG.File]::Create("C:\1812 Overture.mp3")
    [TagLib.Id3v2.Tag] $currId3v2 = $media.GetTag([TagLib.TagTypes]::Id3v2)
    
    $commentFrames = $currId3v2.GetFrames("COMM")
    ...
    

    Sorry if I was not descriptive enough.

    And thanks for the willingness to help.