C# TagLib raise 0xc00d36c4 after add Album Image From Url

0

I try to add album image to my mp3 audio file use TagLib.

but if I open mp3 file after adding album art, the player raises the error 0xc00d36c4.

this is the code I tried...

var wReq = (HttpWebRequest)WebRequest.Create(procItem.Thumbnail);
var wRes = (HttpWebResponse)wReq.GetResponse();

byte[] buffer = new byte[1024];
using (MemoryStream ms = new MemoryStream())
{
    using (Stream s = wRes.GetResponseStream())
    {
        int data;
        while ((data = s.Read(buffer, 0, buffer.Length)) > 0)
        {
            ms.Write(buffer, 0, data);
        }
    }

    TagLib.File tagFile = TagLib.File.Create(procItem.DownloadDirectory);
    IPicture newArt = new Picture(ms.ToArray());
    tagFile.Tag.Pictures = new IPicture[1] { newArt };
    tagFile.Save();
}

one of interesting thing is if I load an mp3 file info in my program, the image control draw album art.

It just raised when mp3 file open.

procitem.Thumbnail is the album image Url

c#
taglib
asked on Stack Overflow Sep 13, 2017 by OverMe • edited Sep 13, 2017 by (unknown user)

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0