Playsound does not work when the block value is set to false

248 Views Asked by At

okaayy so im working on a music player but it not working as i want so the problem is when i play the music using the playsound library it blocks the code from running and freezes the tkinter window but i searched and found out that you can set block to False but when it set to false the music doesn't play.

here is the code:

from playsound import playsound as psound
#a loop here where i get the directory of musics and create a button for every music and each of the button's command value is set to the 'play_sound' function and passing the music directory as argument
    def play_aux(self, dir):
        psound(dir, False)
1

There are 1 best solutions below

0
SwirX On

Okay so i got it working but idk how to check if the sound is still playing so i switched to pygame and it working fine for me!