Search code examples
c#windowsuwpsystem

Using SystemMediaTransportControls to get current playing song info from other app


I write a some program that should work with another player and retrieve info about current playing song. That player is written using UWP, so Windows knows what track is playing, so i can see it's name and other info when changing volume:

https://i.sstatic.net/WSmwh.png

Things I tried:

var systemMediaControls = SystemMediaTransportControls.GetForCurrentView();

From Get current playing track info from Microsoft Groove Music app

Unfortunately, as I understand, it's just for local media, playing from my app.

Background media player doesn't helped too because of same reason.

Is it possible at all to get it from Windows? Or I should directly read memory of that player, heh?


Solution

  • The screen control bar displayed by the music application is not controlled by the system but belongs to the application itself.

    You don't have a way to get playing music in other music software just as you can't get files from the application folder of other applications.

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

    Best regards.