#include "mmsystem.h"
//從檔案播放
PlaySound("C:\\sound.wav", NULL, SND_FILENAME);
TMemoryStream *ms;
ms=NULL;
ms=new TMemoryStream;
ms->LoadFromFile("C:\\sound.wav");
//從記憶體播放
PlaySound((BYTE*)ms->Memory, NULL, SND_MEMORY);
//從記憶體播放
PlaySound((BYTE*)ms->Memory, NULL, SND_MEMORY);
if(ms!=NULL)
{
delete ms;
}
{
delete ms;
}
留言
張貼留言