I am using the following API
https://gist.github.com/1285901
I have this code so far but when it tries to read the tags they all return blank (by tags I mean artist info ect)
using System;
using System.IO;
using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Files();
Console.Read();
}
public static void Files()
{
FileInfo fi = new FileInfo(@"C:\Users\santised\Desktop\music\");
DirectoryInfo di = fi.Directory;
FileSystemInfo[] fsi = di.GetFiles();
foreach (FileSystemInfo info in fsi)
{
Console.Write(info.Name.Replace(".mp3", "") + " Tags: " + Tags(@"C:\Users\santised\Desktop\music\" + info.Name) + "\r\n");
}
}
public static String Tags(String fileName)
{
if (File.Exists(fileName))
{
var file = new FileInfo(fileName);
String returnval = String.Join("; ", file.GetTags()); // .GetTags() is from the api on gist hub
return returnval;
}
return "None;";
}
}
}
The library you are using retrieves tags attributed to files within Windows: it does not retrieves MP3 meta data (ID3) tags. You will need to find a library that is capable of reading ID3 tags, e.g. TagLib Sharp.