qt - C++ Taglib Cover Art from MPEG 4 files -


as side/fun project i'm building audio player (qt application), , 1 of hurdles displaying embedded cover art. *.mp3 files ended not being of issue, example provided here:

static qimage imagefortag(taglib::id3v2::tag *tag) {     taglib::id3v2::framelist l = tag->framelist("apic");      qimage image;      if(l.isempty())         return image;      taglib::id3v2::attachedpictureframe *f =         static_cast<taglib::id3v2::attachedpictureframe *>(l.front());      image.loadfromdata((const uchar *) f->picture().data(), f->picture().size());      return image; } 

however, how can embedded cover arts extracted mpeg 4 files (particularly *.m4a)?

here how it:

taglib::mp4::file f(file); taglib::mp4::tag* tag = f.tag(); taglib::mp4::itemlistmap itemslistmap = tag->itemlistmap(); taglib::mp4::item coveritem = itemslistmap["covr"]; taglib::mp4::coverartlist coverartlist = coveritem.tocoverartlist(); if (!coverartlist.isempty()) {     taglib::mp4::coverart coverart = coverartlist.front();     image.loadfromdata((const uchar *)     coverart.data().data(),coverart.data().size()); } 

image qt qimage class, , "file" char* variable.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -