Why are you playing the Windows error sound instead of the specified file?

0
import winsound


winsound.PlaySound('C:/Users/Computador/Music/Action!/som1.wav', winsound.SND_ASYNC)

When I run this script it does not touch the som1.wav file, but rather the Windows error sound. Why?

    
asked by anonymous 03.08.2018 / 01:27

1 answer

3

The problem was in the absence of the SND_NODEFAULT flag and the directory was wrong.

import winsound

winsound.PlaySound('teste.wav', winsound.SND_FILENAME | winsound.SND_PURGE | winsound.SND_NODEFAULT)

I tested it with mp3 files and it did not work, only with wav

    
03.08.2018 / 17:51