Get Album info in Windows Phone 8.1

好久不见. 提交于 2019-11-27 06:32:17

问题


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?


回答1:


The following works ... sometimes:

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

For folders it seems to always be empty.




回答2:


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

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


来源:https://stackoverflow.com/questions/23429831/get-album-info-in-windows-phone-8-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!