I am trying to read and write audio file properties and managed to do so with ShellFile.Properties.GetProperty and ShellFile.Properties.GetPropertyWriter(). The writer accepts string variables for both text (Album Title) and string objects (Contributing Artists) properties. I can read the string properties but string objects result with "System.String[]" instead of values inside.
My code:
using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
private void GetData()
{
string filePath = "E:\\mySong.mp3";
var shellFile = ShellFile.FromParsingName(filePath);
txtAlbum.Text = shellFile.Properties.GetProperty(SystemProperties.System.Music.AlbumTitle).ValueAsObject.ToString();
txtArtist.Text = shellFile.Properties.GetProperty(SystemProperties.System.Music.AlbumArtist).ValueAsObject.ToString();
txtArtists.Text = (string)shellFile.Properties.GetProperty(SystemProperties.System.Music.Artist).ValueAsObject;
}
How can I read the content of those properties?