0

My aim is for a user to run a command to play a sound file, then run another command to stop the sound file playing. I decided to do this using threads:

def playSong():
    playsound.playsound("song.wav") #using playsound lib, sound is played, thread works

x = threading.Thread(target=playSong)

#command is called
x.start()

I can't seem to find a way to terminate this thread, and other answers such as this are incredibly specific to the OP's scenario.

If anyone could point me in the right direction as of how to do this, I would be grateful.

Joe Moore
  • 1,555
  • 2
  • 7
  • 25

0 Answers0