| Description
This example plays a
wav file synchronously , Put the wav
file in the same location as the source
code .
Code
#include <windows.h>
#include <stdio.h>
int main()
{
printf("Playing synchronous sound...\n");
PlaySound("The Microsoft Sound.wav",
NULL, SND_FILENAME | SND_SYNC);
return 0;
}
Information
tested using Visual
C++ 6
You have to add a library
to the project or you will get errors
. To do this do the following .
1/ Go to the Project
menu and click on settings or press
Alt F7
2/ Click on the Link tab
3/ Where it says Object/library modules
type in winmm.lib. I usually go right
to the end and do this .
4/ Now click on OK .
|