开发者

C++ Taglib Cover Art from .flac and .asf files

I build a project on VS2010 to parser some media files.Seen format spec from http://developer.kde.org/~whee开发者_开发百科ler/taglib.html but couldn't find out a way to get cover from asf and flac files,is there any ways?


For Flac

TagLib::FLAC::File file = File("myfile.flac");  
const TagLib::List<TagLib::FLAC::Picture*>& picList = file.pictureList();
TagLib::FLAC::Picture* pic = picList[0];

For ASF

TagLib::ASF::File file = File("myfile.flac");
const TagLib::ASF::AttributeListMap& attrListMap = file->tag()->attributeListMap();
const TagLib::ASF::AttributeList& attrList = attrListMap["WM/Picture"];
TagLib::ASF::Picture pic = attrList[0].toPicture();

Rainmeter has a nice general implementation of cover art extraction for various fileformats in its NowPlayingPlugin located here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜