0

i know this question has been answered, but the answer didn't work for me. Python winsound, ASYNC flag not working?

I'm trying to play a sound file using winsound asynchronously, but if I use

winsound.PlaySound("sound.wav",winsound.SND_FILENAME|winsound.SND_ASYNC)

It won't play the sound, but if I use

winsound.PlaySound("sound.wav",winsound.SND_FILENAME)

It will, but i need it to be asynchronously so i can stop the audio if needed.

Is there something i'm doing wrong here?

  • 1
    Make sure your program is still running after you call `winsound.PlaySound`. Playback stops as soon as your program exits. – sal Aug 15 '19 at 16:59
  • @sal thanks, my program was finishing after i just called `winsound.PlaySound`, it is correct now. – Ruben Perdigao Aug 16 '19 at 14:09

0 Answers0