Reputation: 27
heres my code
import winsound
winsound.PlaySound('filename.wav',winsound.SND_LOOP)
i want to play it ONCE not in a loop. i tried removing
SND_LOOP
but it didnt work
Upvotes: 2
Views: 248
Reputation: 377
Just don't use the winsound.SND_LOOP
flag. Use 0
or winsound.SND_ASYNC
flag instead.
import winsound
winsound.PlaySound('filename.wav',0)
Upvotes: 1
Reputation: 603
i don't have windows os to test it but according to the docs try this :
import winsound
winsound.PlaySound('filename.wav',winsound.SND_FILENAME)
Upvotes: 0