-2

What I want to do is get an audio file to play while a def (function) is running. I've looked it up and seen that threading works but it is wayyyy to complicated for me to work out. Is there a way you guys can explain it to me? I was using winsound to play the audio file, and SND_FILENAME.

1 Answers1

1

Try this:

from multiprocessing import Process

def play():
    #winsound stuff

def function():
    #functiony stuff

if __name__ == '__main__':
    p = Process(target=play)
    d = Process(target=function)
    p.start()
    d.start()
whackamadoodle3000
  • 6,684
  • 4
  • 27
  • 44