I'm trying to get python to play a audio using winsound, but I keep getting an error and I'm pretty confused. Here's the code:
from winsound import winsound
winsound.PlaySound('C:\Users\David\Desktop\MP5_SMG.wav',winsound.SND_FILENAME)
MP5_SMG.wav is the filename. It gives me the following error:
(unicode error) 'unicodeescape' can't decode bytes in position
2-3: truncated\UXXXXXXXX escape
Also, when the error pops up, the first parentheses is highlighted in red.
I'm open to trying another way to play audio in python. If you have a solution or another please let me now. All help is very much appreciated.