与Windows Phone 8.1一样,可以访问MusicLibrary中的音乐文件。我可以毫无问题地阅读所有文件。
但现在我想阅读专辑信息。
IReadOnlyList<StorageFolder> albums =
await KnownFolders.MusicLibrary.GetFoldersAsync(CommonFolderQuery.GroupByAlbum);
foreach (StorageFolder folder in albums)
{
// how to get album info?
}
如何在foreach中获取相册信息(姓名、艺术家、相册艺术(?
以下工作。。。有时:
var props = await myStorageFileOrFolder.Properties.GetMusicPropertiesAsync();
对于文件夹,它似乎总是空的。
var allSongList =
(await KnownFolders.MusicLibrary.GetFilesAsync(CommonFileQuery.OrderByName)).ToList();
foreach (var file in allSongList)
{
var musicProperties = await file.Properties.GetMusicPropertiesAsync();
}