No subject
herb auld
herbauld at charter.net
Mon Dec 5 22:33:53 UTC 2011
i have need of help regarding "taglib" and writing the "albumartist".
i have a C# program that reads a text file and parse a line to rename and
populate the ID3v2 information.
it mostly works except when it attempts to write the "albumartist" i'm not
getting and error but when i
check the details it is missing from the mp3. it is the line in "red"
here is the code:
private static void readData(string sData)
{
//0 = old file name, 1 = new file name & title, 2 = album
artist, 3 = album, 4 = track number
string[] aRecord = sData.Split(new Char[] { '\t' });
readLP(aRecord[0], aRecord);
}
private static void readLP(string oFilename, string[] aRecord)
{
string sPath = Path.GetDirectoryName(oFilename);
string nFilename = sPath + "\\" + aRecord[1] + ".mp3";
//due to the taglib file and system file i have to specify what
File class
System.IO.File.Move(oFilename, nFilename);
if (!renameTAGS(nFilename, aRecord))
Console.WriteLine("Error");
}
private static bool renameTAGS(string nFilename, string[] aRecord)
{
bool bPass = false;
try
{
TagLib.File file = TagLib.File.Create(nFilename);
TagLib.Id3v2.Tag id3v2Tag =
file.GetTag(TagLib.TagTypes.Id3v2) as TagLib.Id3v2.Tag;
Console.WriteLine("Starting to replace:\r\n");
// Set ID3v2 tag values
id3v2Tag.Title = aRecord[1];
//string[] sArtist = new string[1] { aRecord[2] };
//sArtist[0] = aRecord[2];
//file.Tag.AlbumArtists = sArtist;
id3v2Tag.AlbumArtists = new string[] { aRecord[2] };
id3v2Tag.Album = aRecord[3];
id3v2Tag.Track = Convert.ToUInt16(aRecord[4]);
//save
file.Save();
bPass = true;
}
catch (Exception er)
{
string msg = er.ToString();
Console.WriteLine("Error in renameTAGS\t" + msg);
bPass = false;
}
return bPass;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20111205/afa4d37e/attachment.html>
More information about the taglib-devel
mailing list