winsound not making noise when trying to play .wav files

393 Views Asked by At

I'm using the winsound module to play .wav file but when I run the script there is no error or anything, the script runs fine but no sound:

import winsound

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

There are 1 best solutions below

0
On BEST ANSWER

I got my code to work by removing the winsound.SND_ASYNC

import winsound

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