Reading id3v2 frames with TagLib in Powershell

醉酒当歌 提交于 2019-12-06 07:35:05

This seems to work for me - could you please clarify your question with what isn't working?

# load the TagLib# assembly into PowerShell
[Reflection.Assembly]::LoadFrom("C:\taglib-sharp.dll")

# grab the MP3 file with TagLib
$file = [TagLib.File]::Create("C:\overture.mp3")

# read the COMMENT tag field
$file.Tag.Comment

For me at least, this output the following line:

Amazon.com Song ID: 123456789

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!