locked
indecipherable code in musicproperties.Genre ???

    Question

  • Hi I've create a little piece of code where I retrieve music Genre using this class:http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.fileproperties.musicproperties

    Now the code is naive

     ...
               // Get music properties
                  MusicProperties musicProperties = await file.Properties.GetMusicPropertiesAsync();
                  outputText.AppendLine("Album: " + musicProperties.Album);
                  outputText.AppendLine("Rating: " + musicProperties.Rating);
                  outputText.AppendLine("Genre: " + musicProperties.Genre[0]);

    the output is something weird like this:

    Genre: [18,8,9000000012d]

    Any idea???

    Thanks

    Tuesday, October 14, 2014 6:44 AM

Answers

  • I think it's the file itself. Your code works fine with the .mp3 file I have.  I chose a file with a known genre and it came out exactly as I expected.  You can see the properties of the file itself if you right-click that file and go to "Details".

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, November 11, 2014 1:56 PM
    Moderator

All replies

  • Do all music files give this kind of information, or just one file?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, October 14, 2014 12:29 PM
    Moderator
  • sorry for delay in answer 

    yes I find in every songs so for example an output is 18,8,9000000 other 18,8,900012d and is a string...

    seems a vector in a string, an I dunno why

    an the property is MusicProperties.Genre[0]

    thanks


    • Edited by My Disco Gr Thursday, October 30, 2014 8:11 PM
    • Proposed as answer by craig91 Tuesday, December 9, 2014 2:00 AM
    Thursday, October 30, 2014 8:11 PM
  • Any Idea ??
    Friday, November 7, 2014 8:05 PM
  • I think it's the file itself. Your code works fine with the .mp3 file I have.  I chose a file with a known genre and it came out exactly as I expected.  You can see the properties of the file itself if you right-click that file and go to "Details".

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, November 11, 2014 1:56 PM
    Moderator
  • really strange, the problem isn't for just one file but for a great number, not I will try to install windows ce  try to other pc...

    thanks :)

    Tuesday, November 18, 2014 12:57 PM
  • There is definitely a bug. I have identical code and it shows 18,9,900000012,  18,9,900000013, 18,9,900000014, and so on..

    These files show the correct Genre when navigation the storage and right clicking and viewing the properties from Windows. The files were all transferred using the windows phone desktop app.


    • Edited by craig91 Tuesday, December 9, 2014 1:54 AM
    • Proposed as answer by craig91 Thursday, December 11, 2014 8:38 PM
    Tuesday, December 9, 2014 1:52 AM