I don't know how to get the name of the current source playing in pyglet, I put different sources in a playlist and the playlist is playing one of the sources randomly, here's my code:
player = pyglet.media.Player()
music1 = pyglet.media.load('A file.mp3')
music2 = pyglet.media.load('An other file.mp3')
music = random.sample([music1, music2], k=2)
player.queue(music)
player.play()
What I've tried:
print(player.source)
What I get:
<pyglet.media.codecs.wmf.WMFSource object at 0x000002AE2C4CB610>
And what i want is:
'filename.mp3'
I'm pretty bad with pyglet so please help me.