#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);
}

arrow
arrow
    全站熱搜

    讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣()