0

I recently stumbled upon an SO question that pointed at using WinRT (discontinued in Python 3.10), that helps handle Windows Runtime APIs. I wanted to use it to develop a basic desktop overlay that shows a list of currently running audio sources (primarily, Spotify). I did accomplish everything else, concering the UI and such, using tkinter.

The main problem is that the support for Python WinRT discontinued for the 3.10 version, (and onwards), and I can not find libraries that might substitute it. The main solutions I find include downgrading to Python 3.9 (or, using a venv, which sounds better), or just using a community fork (PyWinrt), but I'm not really putting these hacks or workarounds at a priority, I might be willing to opt for these if there is no other possible solution.

Is it still possible to develop such an overlay using only Python? Since I'm using Tkinter, all i would need is an image of the current playing track, the application that is running it, progress in the audio (in ms or s), and the name of the track. Keeping it simple, I'm trying to avoid audio control, such as skipping the track, or changing the relative timestamp.

I did try using the Spotify WebAPI to specifically grab info related to the track currently playing, but the work involved with refresh oauth tokens, and creating logins for just looking at the track seems a bit much work, since I believe it would be easier done natively; plus, what I'm trying to aim for, is a general purpose audio source info, rather than just Spotify.

Here, is a picture of Windows' Gamebar, that shows what I'm trying to achieve: GamebarOverlay.

Quine.cc
  • 1
  • 1
  • These type of questions are unfortunately off topic to [so]. But to give you at least a hint, since you seem willing to develop it by yourself, take a look at ctypes as pywin32 does not offer an easier implementation. – Thingamabobs Oct 20 '22 at 18:10
  • Ah. So, I should be writing a C++ equivalent for grabbing the info, then wrap it in python using ctypes? If I'm correct, then that is definitely an interesting way to go about it. – Quine.cc Oct 20 '22 at 18:27

0 Answers0