none
[UWP][C#] How to get current song from the operating system RRS feed

  • Question

  • So I have noticed recently that Spotify is displaying the current song and album and icon in the Windows 10 fashion. I am aware that Spotify isn't doing this, it is the operating system displaying this information. So therefore the operating system must know about that information so how can I get that information?

    What C# API's are available for this?

    Music


    Tuesday, June 6, 2017 1:49 PM

Answers

  • Hi BaileypctMiller,

    There’re no built-in APIs for you to get the current song from OS. But you could get the storage file’s information (displayname, thumbnail, album etc.) in your own app.

    For example, I assume that you’re developing an UWP app which is used to play music. Then you will need to get some storage files from some places (e.g, MusicLibrary or other positions) as play list.

    That is to say, you have access to these storage files, then you could get their specific information when your player is playing the specific audio file.

    Anyway, if you just want to get current song from OS, there’s no such API for you.

    Best Regards,

    Xavier Eoro


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 7, 2017 2:00 AM
    Moderator

All replies

  • Hi BaileypctMiller,

    There’re no built-in APIs for you to get the current song from OS. But you could get the storage file’s information (displayname, thumbnail, album etc.) in your own app.

    For example, I assume that you’re developing an UWP app which is used to play music. Then you will need to get some storage files from some places (e.g, MusicLibrary or other positions) as play list.

    That is to say, you have access to these storage files, then you could get their specific information when your player is playing the specific audio file.

    Anyway, if you just want to get current song from OS, there’s no such API for you.

    Best Regards,

    Xavier Eoro


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 7, 2017 2:00 AM
    Moderator
  • Thank you, is there a place where I can request this API? Seems like a really small feature that would help me with an app I am looking to develop.
    Friday, June 9, 2017 12:08 PM
  • I don't believe that the OS itself is handling the display of the song and artist information. This the responsibility of the app playing the media, in this case Spotify. See this article, Integrate with the System Media Transport Controls.

    I used these same techniques for showing the song information in the SMTC for my app, SomaFM.

    Friday, June 9, 2017 1:37 PM
  • Thank you, is there a place where I can request this API? Seems like a really small feature that would help me with an app I am looking to develop.
    You could submitFeature Requests” on WPDev UserVoice 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 13, 2017 1:41 AM
    Moderator