I made a c# player with WMPLib and TagLib. My files are listed in a listview, i can click right on a row and in a popup add some tag (Year, rating...). When the file is not playing, the tags can be saved in the file ( wav format) but not when playing. Error : can't save because file in use.
i tryed to use async await but i don't know how it works in this case. Here is the code to put 1 star as rating tag :
private void t_star_1_Click2(object sender,EventArgs e) {
if(listView1.Items != null){soundpath = listView1.SelectedItems[0].SubItems[8].Text;};
var tagdusound = TagLib.File.Create(soundpath.ToString());
Tag tagg = tagdusound.GetTag(TagTypes.Id3v2);
PopularimeterFrame frame = PopularimeterFrame.Get((TagLib.Id3v2.Tag)tagg, "Windows Media Player 9 Series", true);
frame.Rating = 1;
tagdusound.Save();PlaylistList_update();
}// Click droit ★