taglib save mp3 picture information

荒凉一梦 提交于 2020-04-07 10:35:50

问题


This is driving me nut. I'm trying to save the picture description of a picture in a MP3 (i tried the same process with the picture type with 0 success). i cant manage to save this information, here is my code :

    foreach (var so in mp)
            {
                int tries = 50;
                using (TagLib.File fill = TagLib.File.Create(so.Item1))
                {
                fill.Tag.Pictures[i].Description = (string)cont.SelectedItem;
                try
                    {
                        fill.Save(); }
                    catch (Exception e)
                    {
                        if (tries != 0)
                        {
                            System.Threading.Thread.Sleep(50);
                            Console.WriteLine(e);
                            tries--;
                        }
                        else throw;
                    }
                }
            }

so.Item1 is the path of each of the files i would like to process (all the songs in an album). cont is a Combobox control.

"i" is used for one specific image in the Mp3 file that can contain several images(that's the reason why i need description)

During the step by step process, it goes to the fill.Save everytime and never to the catch.

Edit : The exceptions i had are due to something else, but have nothing to do with the Saving process.

What am i doing wrong ?

thanks in advance

来源:https://stackoverflow.com/questions/60714856/taglib-save-mp3-picture-information

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!