I am trying to read "Bit rate" property of audio files. I know how to get the value but the way I am doing it I don't think is the most efficient.
Shell shell = new Shell32.Shell();
Folder objFolder = shell.NameSpace(path);
for (int i = 0; i < short.MaxValue; i++)
{
string property = objFolder.GetDetailsOf(null, i);
if (String.IsNullOrEmpty(property))
break;
if (property.Equals("Bit rate"))
{
index = i;
break;
}
}
FolderItem item = objFolder.ParseName(fileName);
string bitRateValue = objFolder.GetDetailsOf(item, index);
My concern is that for loop which I need to get the index of "Bit rate", so for all my tests returned me index 28, therefore I started to wonder if Bit rate can be found always at index 28? If not then is there any better way to find out at which index Bit rate is located?