有一种等效场标签/发行商在标签库锋利? [英] Is there an equivalent field to Label/Publisher in taglib-sharp?

查看:148
本文介绍了有一种等效场标签/发行商在标签库锋利?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试更新使用标签库锋利标签/发行领域,但使用对象浏览器看不到它的任何地方在它的对象层次。

I'm trying to update the label/publisher field using Taglib-sharp, but I can't see it anywhere in its Object Hierarchy using Object Browser.

我已经通过谷歌和文档搜索,它看起来像它是不是照顾一个字段。

I've searched through google and the documentation and it looks like it's a field that's not catered for.

在我寻找替代品(可以任何一个建议?),可以编辑这些领域,我想我还有最后一个裂缝,并要求计算器界谁是熟悉的TagLib锋利有一个更明智的意见,即在?

Before I look for alternatives (can any one suggest any?) that can edit those field, I thought I'd have one last crack and ask within the StackOverflow community who is familiar with TagLib-sharp that had a more informed opinion?

在此先感谢,

弗朗西斯

更新:我已经调查了其他库,如mpg123的&放大器; UltraID3Lib但他们似乎有着类似的限制。

Update : I've investigated other libraries such as mpg123 & UltraID3Lib but they seem to have the same limitations.

推荐答案

好了标签库#不能读取发布商代码。即使是最新的版本(2.1.0.0)截至目前将无法做到这一点。作为一种替代方法,您可以使用标签库#,这是免费提供源$ C ​​$ C添加这个功能吧。

Well TagLib# is not able to to read the publisher tag. Even the newest version (2.1.0.0) as of now won't be able to do that. As an alternative you can add this functionality yourself using the source code of TagLib#, which is freely available.

要做到这一点,打开文件的标签库/ ID3V2 / FrameTypes.cs ,然后在某处添加以下行:

To do so, open the file TagLib/Id3v2/FrameTypes.cs and add the following line somewhere:

public static readonly ReadOnlyByteVector TPUB = "TPUB";  // Publisher field

和文件中的标签库/ ID3V2 / Tag.cs​​

public string Publisher {
    get {return GetTextAsString (FrameType.TPUB);}
    set {SetTextFrame (FrameType.TPUB, value);}
}

您可以然后使用像这样访问出版商场

You can then access the Publisher field using something like this

TagLib.File tf = TagLib.File.Create(...);   // open file
tf.Tag.Publisher = "Label XY";              // write new Publisher
tf.Save();                                  // save tags

请注意,这是一个丑陋的黑客攻击,但会为MP3文件。

Please note, that this is an ugly hack but will work for MP3 files.

这篇关于有一种等效场标签/发行商在标签库锋利?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆