简体   繁体   中英

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?

The following works ... sometimes:

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

For folders it seems to always be empty.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM