#include <windows.h>
#pragma comment(lib,"Winmm.lib")
usingnamespace std;
{
int main ( )
PlaySound(TEXT("c:\\ding.wav"), NULL, SND_LOOP);
}
I am unable to get the sound to loop.I've referenced MSDN on how it should work, but I can't seem to get this working. There is obviously something I'm over looking.
Also, I have tried SND_LOOP|SND_ASYNC and a few other combinations hoping it would have an effect.
I was wondering if anyone had a solution. (I removed most of the code because it doesn't seem to have an influence on the function when I commented it out. If you need to see the whole thing I'll post it.)
It probably works because if you don't have a "pause" there, then the program ends before the sound even starts playing, since you aren't blocking and waiting for it to finish.