使用 TagLib 从 MP3 文件中提取 GUID
所以,我的最终目标是从我的音频文件中获取专辑封面。我正在使用 taglib 和 c++。我找到了有关如何提取嵌入图像数据的信息,但 Windows Media Player 似乎没有嵌入图像本身。相反,它会保存名为 AlbumArt_{E3208100-4FAA-4030-BB9D-6DA5F9D93D18}_Large.jpg 之类的 jpg。显然它使用了一个 guid,我相信它保存在 PRIV 标签中。我向你们提出的问题是我怎样才能到达它?我认为这样的事情可能会起作用:
ID3v2::PrivateFrame* privFrame = static_cast<ID3v2::PrivateFrame*>(*privIter);
if(privFrame != NULL)
{
std::string owner = privFrame->owner().toCString();
if (owner == "WM/WMCollectionID" || owner == "WM/WMCollectionGroupID")
{
const char* data = privFrame->render().data();
GUID guid;
memcpy(&guid.Data1, data, sizeof(long));
}
}
但数据似乎没有任何有用的东西。有什么想法吗?
so, my end game is getting album art from my audio files. i'm using taglib and c++. i've found info about how to extract embedded image data, but it seems windows media player does not embed the image itself. instead, it saves a jpg named something like AlbumArt_{E3208100-4FAA-4030-BB9D-6DA5F9D93D18}_Large.jpg. clearly it's using a guid, which i believe it saves in a PRIV tag. my question to you folks is how can i get to it? i thought something like this might work:
ID3v2::PrivateFrame* privFrame = static_cast<ID3v2::PrivateFrame*>(*privIter);
if(privFrame != NULL)
{
std::string owner = privFrame->owner().toCString();
if (owner == "WM/WMCollectionID" || owner == "WM/WMCollectionGroupID")
{
const char* data = privFrame->render().data();
GUID guid;
memcpy(&guid.Data1, data, sizeof(long));
}
}
but data doesn't seem to have anything useful. any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于那些有类似问题的人,据我所知 taglib 的 PrivateFrame 已损坏。因此,我推出了自己的:
for those with similar problems, as far as i can tell taglib's PrivateFrame is broken. thus, i have rolled my own: