Oct 20, 2011 at 2:23am
Hey guys, for anyone who's interested, I've found the solution to my problem.
The reason why it wouldn't play is because it needs two slash "\" symbols. Here's my new code.
1 2 3 4 5 6 7 8 9 10 11
|
#include<iostream>
#include<windows.h>
#include<mmsystem.h>
#include<stdlib.h>
using namespace std;
int main (char argc)
{
PlaySound(TEXT("C:\\buzz.wav"), NULL, SND_FILENAME | SND_ASYNC); // remember you need 2 slashes these "\\"
system("pause");
return 0;
}
|
It works :) Also remember you need to pause to stall the program somehow! Without the "system("PAUSE")" , it would not of worked!
Last edited on Oct 20, 2011 at 2:29am