Jan-07-2020, 02:45 PM
Hi
I work on audio player, I use Tkinter for GUI and Pygame for media.
I would like to make a playlist of songs and to play them with pygame.mixer.music
There is a function "queue()", but it doesn't work, actually. In fact, it can take only one song in queue, no more.
So, what I can do? I tried to implement it throut loop:
but the problem is that user can't interact with GUI until the loop breaks. It means that user is not able to pause music or stop it.
How I can solve this problem with Pygame? Or it is better to use other library ?
P.S. I browsed GitHub, it turned out that people make audio players with pygame, but it doesn't support playing a playlist of songs.
I work on audio player, I use Tkinter for GUI and Pygame for media.
I would like to make a playlist of songs and to play them with pygame.mixer.music
There is a function "queue()", but it doesn't work, actually. In fact, it can take only one song in queue, no more.
So, what I can do? I tried to implement it throut loop:
1 2 3 4 5 6 7 8 9 10 11 |
running = True ; while running: if ( self .mixer.get_busy() = = False and files ! = False ): self .mixer.load ( self .playlist[files.pop()] ) self .mixer.play( 1 ) if (files = = False ): running = False ; break ; |
How I can solve this problem with Pygame? Or it is better to use other library ?
P.S. I browsed GitHub, it turned out that people make audio players with pygame, but it doesn't support playing a playlist of songs.