In my game, I'm using the Playsound Python module in Python version 2.7. I can get a sound to play using the commands shown in the documentation. But I can't find how to turn the sound off.
from playsound import playsound # Imports Library To Play Sound
def playy():
playsound('music.mp3')
T = Thread(target=playy)
T.start()
The T
is part of multithreading so the program plays music while the game runs. The playsound
function above plays the sound I want but it won't turn off. I've tried many things like playsound = False
. But I can't seem to turn it off.