Philippe Maes
Philippe Maes

Reputation: 510

Get Album info in Windows Phone 8.1

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?

Upvotes: 1

Views: 1588

Answers (2)

reza.cse08
reza.cse08

Reputation: 6178

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

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

Upvotes: 0

HDW Production
HDW Production

Reputation: 1402

The following works ... sometimes:

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

For folders it seems to always be empty.

Upvotes: 3

Related Questions