Search code examples
pythonwavwinsound

winsound not making noise when trying to play .wav files


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)

Solution

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

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