I would like to know how to add a cover (jpg file) to a mp3 file (I'm working with the c#).
Code:
using System.IO;
using IdSharp.Tagging.ID3v2;
using IdSharp.Tagging.ID3v2.Frames;
...
string mp3FileName = @"C:\mp3file.mp3";
string pictureFileName = @"C:\picturefile.jpg";
ID3v2 id3v2 = new ID3v2(mp3FileName);
IAttachedPicture picture = id3v2.PictureList.AddNew();
picture.PictureData = File.ReadAllBytes(pictureFileName);
picture.PictureType = PictureType.CoverFront; // optional
id3v2.Save(mp3FileName);
I would like to know if this picture will be linked to the mp3 file even if the jpg file is removed from the hard disk or if the mp3 file is moved.
Yes, the picture is saved in the ID3v2 tag.
Bookmarks