Hi i am having a few problems with the winsound i want to play a short sound clip and on this page here: Play a Sound with Python it is said that this should work:
import winsound
winsound.PlaySound('sound.wav', winsound.SND_FILENAME)
on mine i get the error, the program and the audio file which is a .wav are both in the same folder, and im not sure why any help? Code:
import winsound
winsound.PlaySound('sound.wav', winsound.SND_audio)
Error:
Traceback (most recent call last):
File "C:\Users\----\----\python\test\soundtest.py", line 3, in <module>
winsound.PlaySound('sound.wav', winsound.SND_audio)
AttributeError: module 'winsound' has no attribute 'SND_audio'