Incorrect Results for GetMusicPropertiesAsync()


  • Hi all,

    I've been working on getting the tag info from mp3s, but I have a few results that are incorrect when using the storagefile access method. Specifically, when retrieving a few files which have no Title, artist, or album name listed it appears to pull a title from somewhere else in the tag. When I checked to see if the title it created existed in the mp3 properties|details tab, there is not one entry for the Title it chose. When I look at the Xbox music app it does not have a problem with these files as it just chooses the file name so I assume there is a way to manually retrieve the track title instead of using MusicProperties.Title. I know we can do it for the artist as I was having a similar issue with not being able to retrieve contributing artists, but now use:

    var musicProperties = await track.MusicProperties.RetrievePropertiesAsync(new String[] { "System.Music.Artist" });
    var cArtists = (string[])musicProperties["System.Music.Artist"];

    I would do the same for the title, but System.Music.Title does not exist. Any thoughts or ideas are greatly appreciated! :)



    Tuesday, March 25, 2014 11:25 PM

All replies

  • Hi Jeremy,

    Just a really simply question, why not use Artist or Title directly from MusicProperties class?


    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, March 26, 2014 2:36 AM
  • Jamles,

    That is the issue. I would prefer to use them, but they are providing incorrect values for the artist or the Title. As I mentioned above, when I used Title from the MusicProperty class, it provides a title which does not match the one I find when I navigate to the properties of the mp3 through windows explorer. I believe this is similar to why when I called Artist from the MusicProperty class it also retrieved the wrong value. When calling artist, it calls "DisplayArtist" which does not always return the contributed artists as it is suppose to if its available, but rather returns the AlbumArtist. This issue may be an error in the windows 8.1 sdk. Either way, I believe when I call Title it then calls DisplayTitle and when it searches for the best Title which is not always the optimum like in my case.

    This is why I'm looking for a backdoor approach like I do for grabbing the contributed artists.

    Thanks for the interest and i look forward to your response.


    Wednesday, March 26, 2014 3:36 AM
  • Edit:

    Woops, I was wrong. I thought I had fixed the problem but since many of the Titles are similar to the parsed filename, I did not realize it was still incorrect. Hence, I am still struggling at finding a solution. Any thoughts/comments would be wonderful! Thanks.


    After manually trying all the System.#### properties, I landed on the one that should be used. It is "System.ItemDisplayName". I can now properly get the correct name to display. While it does not comeback null as the title suggests, if there is no title it substitutes the file name which is most appropriate for my case. Hopefully, Microsoft will fix this in the future :) and that it also solves this problem for other people as well!



    • Marked as answer by JGSweets Wednesday, March 26, 2014 10:13 PM
    • Unmarked as answer by JGSweets Thursday, March 27, 2014 4:25 AM
    • Edited by JGSweets Thursday, March 27, 2014 4:27 AM Not correct answer.
    Wednesday, March 26, 2014 10:12 PM
  • I have yet to find a solution and believe the only resolution might be using a 3rd party mp3 tag lib to attain the desired results. I also cannot seem to discover where MusicProperties.Title is pulling the title it chooses from as it is not represented in any of the other properties. I might manually try and search the stream soon, but I think this might be related to the fact that the Title is suppose to come back blank and it instead pulls a pseudo Title from somewhere else.



    Saturday, March 29, 2014 6:46 AM
  • I discovered a workaround since the error only occurs when accessing the file using the class, FileInformation. Originally, I was retrieving files in this manner:

    QueryOptions options = new QueryOptions(CommonFileQuery.OrderByDate, new string[] { ".mp3" });
                StorageFileQueryResult trackQuery = Windows.Storage.KnownFolders.MusicLibrary.CreateFileQueryWithOptions(options);
                FileInformationFactory trackFactory = new FileInformationFactory(trackQuery, ThumbnailMode.MusicView);
                // Get all the tracks
                IReadOnlyList<FileInformation> tracks = await trackFactory.GetFilesAsync();

    This produces the error talked about above (when looking at the individual FileInformation in the list). However, if I instead acquire the music properties like this:

    var file = await StorageFile.GetFileFromPathAsync(track.Path);
                    var cccccc = await file.Properties.GetMusicPropertiesAsync();

    The music properties are as expected for the title. It's unfortunate that that I have to do it this way, but as long as it works I'm happy.

    Friday, April 18, 2014 5:19 AM