1
votes

As from Windows Phone 8.1, it's possible to get access to the music files in the MusicLibrary. I can read all files without problems.

But now I want to read Album info.

IReadOnlyList<StorageFolder> albums = 
     await KnownFolders.MusicLibrary.GetFoldersAsync(CommonFolderQuery.GroupByAlbum);

foreach (StorageFolder folder in albums)
{
    // how to get album info?            
}

How can I get album info (name, artist, album art) in that foreach?

2

2 Answers

3
votes

The following works ... sometimes:

var props = await myStorageFileOrFolder.Properties.GetMusicPropertiesAsync();

For folders it seems to always be empty.

0
votes
var allSongList = 
  (await KnownFolders.MusicLibrary.GetFilesAsync(CommonFileQuery.OrderByName)).ToList();

foreach (var file in allSongList)
{
   var musicProperties = await file.Properties.GetMusicPropertiesAsync();
}