For a program I'm writing, I need to get the current playing song from windows media player.
I've googled around a lot, but everything I found was about playing music VIA windows media player and getting information from that.
What I specifically want, someone has WMP open, and he has a song playing. I need to get the name of that song.
I've tried:
import win32com.client
wmp = win32com.client.gencache.EnsureDispatch('WMPlayer.OCX')
However, this doesn't control or do anything with the currently opened WMP instance.
I've also found something about using wmp.dll
with ctypes
, but I have no idea where to look or what to do with it. Related-source.
Can anyone shed some light on this? There were some other SO posts about the same question, but they don't really help me out.