软件:
vs2010
工程:
控制台程序(空工程)
代码如下:
/*
mciSendCommand播放音乐,调用简单,功能强大,但是它只能同时播放一个
文件,而有的项目中需要同时播放几个文件,实现混音效果,这时就要使用
DirectSound或者其它库或技术了!
*/
#include <Windows.h>
#include <MMSystem.h>
#include <map>
#include <iostream>
using namespace std;
#pragma comment(lib, "WINMM.LIB")
void PlayBeep()
{
Beep(3000,500);
}
void PlaySysMusic()
{
MessageBeep(MB_OK);
Sleep(800);
MessageBeep(MB_ICONWARNING);
Sleep(800);
MessageBeep(MB_ICONSTOP);
Sleep(800);
MessageBeep(MB_ICONERROR);
Sleep(800);
MessageBeep(MB_ICONEXCLAMATION);
}
void PlayWavMusic()
{
PlaySound("GAME_WIN.WAV",NULL/*AfxGe
软件:
vs2010
工程:
控制台程序(空工程)
代码如下:
/*
mciSendCommand播放音乐,调用简单,功能强大,但是它只能同时播放一个
文件,而有的项目中需要同时播放几个文件,实现混音效果,这时就要使用
DirectSound或者其它库或技术了!
*/
#include <Windows.h>
#include <MMSystem.h>
#include <map>
#include <iostream>
using namespace std;
#pragma comment(lib, "WINMM.LIB")
void PlayBeep()
{
Beep(3000,500);
}
void PlaySysMusic()
{
MessageBeep(MB_OK);
Sleep(800);
MessageBeep(MB_ICONWARNING);
Sleep(800);
MessageBeep(MB_ICONSTOP);
Sleep(800);
MessageBeep(MB_ICONERROR);
Sleep(800);
MessageBeep(MB_ICONEXCLAMATION);
}
void PlayWavMusic()
{
PlaySound("GAME_WIN.WAV",NULL/*AfxGe