I'm developing a tkinter application where video's and sounds are queued and played back based on certain events.
For this I use python-vlc, but I haven't found a way to play multiple sounds at the same time (besides multithreading). The videos would also need their own window for this to work.
the following code is from a module pure for testing this.
import vlc
files = ['/home/silver/Desktop/hl1sfx/sound/gman/gman_potential.wav',
'/home/silver/Desktop/hl1sfx/sound/gman/gman_nasty.wav',
'/home/silver/Desktop/hl1sfx/sound/gman/gman_nowork.wav',
'/home/silver/Downloads/atlas_motor_jitter.mp4']
instance = vlc.Instance ()
medias = [instance.media_new (f) for f in files]
player = vlc.MediaPlayer ()
for m in medias:
input ('>> ')
player.set_media (m)
player.play ()
if player.is_playing ():
p = vlc.MediaPlayer (m)
p.play ()
input ('next?')
Even creating a new mediaplayer doesn't work. Is seperate threads for each file the solution or am I overlooking some feature in python-vlc?