I'm trying to find out how to list the music on my computer by a certain artist. I understand how to list all the music in the directory but I can't find a way to show only the music from one of the artists. Below is the code I'm using to list all the music in the directory.
How do I search the meta data for the artist's name and filter those files? Feel free to comment on the code if that's not a good way to list the files, I'm pretty new to all of this.
Code Fragment:
File musicList = new File("C:\\Users\\Music");
String[] fileNames = musicList.list();
String songsResponse = "";
int number = 1;
for(int i = 0; i < fileNames.length; i++)
{
if(fileNames[i].endsWith(".mp3"))
{
songsResponse += (number + ". ") + fileNames[i] + "\n";
number++;
}
}