Hi,
I am trying to a play a .wav file in a C++ program.
I think my code is OK, but when it plays, it plays the default windows 'error' sound, not my .wav file.
This is the program:
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib,"Winmm.lib")
using namespace std;
int main()
{
for( int a = 0;a<10;a++)
{
PlaySound((LPCWSTR)"tone.wav", 0, SND_LOOP|SND_ASYNC);
Sleep(1000);
}
return 0;
}
How can i add the .wav file so it is found?
In the Visual Studio 2005 soulution explorer I right click on Resource Files>Add>Resource, but can't find an option for .wav.
Thanks for any help!