node.jselectron

Using NPM, Electron or a CLI program get information about the media that is currently playing on the computer


I am developing a application that will display the name and icon of the media that is currently playing on the PC. Something similar to the old windows banner when you changed your volume. I have not found a solution within Electron or a NPM library to be able to do this. I was wondering if anyone knew a way using Electron, A NPM library or a CLI tool to do this?

I have tried googling for something that would match this but I have no found anything. I would like to be able to get the album/video artwork and the name of what is playing.

An example of the information I am trying to gather is here. https://help.wallpaperengine.io/en/audio/mediaintegration.html


Solution

  • I ended up using the https://pypi.org/project/winrt/ python library and sending the information using a post request using express.

    I tried using pipes with spawn but the information sent over the pipe was sent at inconsistent intervals and special characters like Japanese language characters would show incorrectly.

    I also tried using https://www.npmjs.com/package/@nodert-win11/windows.media.control but I could not get it working.