Adding previously extracted iTunSMPB tag to m4a files

Morten With morten.with at gmail.com
Sat Oct 5 04:19:00 BST 2019


Hi there,

I have a somewhat odd problem with copying tags that requires me to
extract the iTunSMPB information (for gapless aac playback) from an
m4a file, and after processing it with mp3tag, add that info back to
the file.

I can already extract the info the following way (just a quick & dirty test):

	TagLib::MP4::ItemListMap ilm = f.tag()->itemListMap();

	for (TagLib::MP4::ItemListMap::ConstIterator it = ilm.begin(); it !=
ilm.end(); ++it)
	{
		if ((*it).first.rfind("iTunSMPB") != -1)
		{
			printf("%s\n", (*it).second.toStringList()[0].toCString()); // do
whatever here
		}
	}

Which gives me a string such as " 00000000 00000840 00000380
00000000008EAC40 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000".

How would I go about adding that info to an m4a file? I'm completely
new to this library and have no idea how to add it back to the MP4
file in a way it gets saved on f.save();.

Thanks for any help regarding this,
Morten


More information about the taglib-devel mailing list