#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
void PlayBGM(std::wstring path)
{
wchar_t buf[128];
//use mciSendString()
mciSendString((L"play "+ path).c_str(), buf, sizeof(buf),NULL);
mciSendString((L"setaudio " + path + L" volume to 200").c_str(), buf,sizeof(buf),NULL);
}
void StopBGN(std::wstring path)
{
wchar_t buf[128];
mciSendString((L"stop " + path).c_str(), buf, sizeof(buf),NULL);
}
全站熱搜
留言列表