Then your code is wrong... |
Shouldn't this output sound? At least one of them?
1 2 3 4 5 6 7 8 9 10 11 12
|
#include "stdafx.h"
#include <iostream>
#include <windows.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "\a\a\a\a\a\a\a\a";
Beep (500,50);
return 0;
}
|
I get nothing. Am I not including something necessary into my code?
On the plus side, I've managed to get PlaySound to play a sound...kind of. This does output sound.
1 2 3 4 5 6 7 8 9 10 11 12
|
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#pragma comment( lib, "winmm" )
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS);
return 0;
}
|
However, I'm still having trouble getting it to output wavs that I input as a resource file.
I am adding them by going to the Resource Files in the Solution Explorer, Add Resource... > Import... > choose my wav file.
The code will compile, but nothing comes out.
To test it, I'm trying
PlaySound(TEXT("Final Fantasy XIII - Battle Theme"), NULL, SND_ASYNC | SND_LOOP);
and
PlaySound(TEXT("Final Fantasy XIII - Battle Theme"), NULL, SND_RESOURCE | SND_ASYNC);
I believe my problem may be that I need to #include the wav file at the top of my source code, but I'm not getting that to work. Perhaps I'm writing what to include improperly.
Does anyone know how I can properly work a wav file into my project?