I'm trying to copy all ID3v2 tags from one file to another. But my code does not work (the tags remain unchanged) and I do not know why.
ID3_Tag sFile, tFile;
sFile.Link("source.mp3", ID3TT_ID3V2);
tFile.Link("target.mp3");
tFile.Strip();
ID3_Tag::Iterator* sFrItr = sFile.CreateIterator();
ID3_Frame* sFrame = NULL;
while (NULL != (sFrame = sFrItr->GetNext()))
{
tFile.AddFrame(sFrame);
}
delete sFrItr;
tFile.Update();
This code is mostly based on id3lib API example. I didn't have anything to do with id3 earlier, so I might just not be understanding how the frames and fields work.