PlaySound同时播放两wav
能不能用PlaySound同时播放两个WAV文件?如果能,怎么弄?谢谢了!mciSendCommands函数是不是vc++的?如果是,编译预处理用加些什么头文件?...
能不能用PlaySound同时播放两个WAV文件?如果能,怎么弄?
谢谢了!
mciSendCommands函数是不是vc++的?
如果是,编译预处理用加些什么头文件? 展开
谢谢了!
mciSendCommands函数是不是vc++的?
如果是,编译预处理用加些什么头文件? 展开
3个回答
展开全部
mciSendCommand函数可以同时播放两个音乐
MCIDEVICEID dev[20];
MCI_OPEN_PARMS mciOpen;
MCI_PLAY_PARMS mciPlay;
{
mciOpen.lpstrElementName="./music/1.mp3";
if(mciSendCommand(NULL,MCI_OPEN, MCI_OPEN_ELEMENT ,
(DWORD)&mciOpen)==0)
dev[0]=mciOpen.wDeviceID;
else
mciOpen.wDeviceID=dev[0];
mciPlay.dwFrom = 0;
mciSendCommand(mciOpen.wDeviceID,MCI_PLAY,MCI_NOTIFY | MCI_FROM,(DWORD)&mciPlay);
}
{
mciOpen.lpstrElementName="./music/2.mp3";
if(mciSendCommand(NULL,MCI_OPEN, MCI_OPEN_ELEMENT ,
(DWORD)&mciOpen)==0)
dev[1]=mciOpen.wDeviceID;
else
mciOpen.wDeviceID=dev[1];
mciPlay.dwFrom = 0;
mciSendCommand(mciOpen.wDeviceID,MCI_PLAY,MCI_NOTIFY | MCI_FROM,(DWORD)&mciPlay);
}
MCIDEVICEID dev[20];
MCI_OPEN_PARMS mciOpen;
MCI_PLAY_PARMS mciPlay;
{
mciOpen.lpstrElementName="./music/1.mp3";
if(mciSendCommand(NULL,MCI_OPEN, MCI_OPEN_ELEMENT ,
(DWORD)&mciOpen)==0)
dev[0]=mciOpen.wDeviceID;
else
mciOpen.wDeviceID=dev[0];
mciPlay.dwFrom = 0;
mciSendCommand(mciOpen.wDeviceID,MCI_PLAY,MCI_NOTIFY | MCI_FROM,(DWORD)&mciPlay);
}
{
mciOpen.lpstrElementName="./music/2.mp3";
if(mciSendCommand(NULL,MCI_OPEN, MCI_OPEN_ELEMENT ,
(DWORD)&mciOpen)==0)
dev[1]=mciOpen.wDeviceID;
else
mciOpen.wDeviceID=dev[1];
mciPlay.dwFrom = 0;
mciSendCommand(mciOpen.wDeviceID,MCI_PLAY,MCI_NOTIFY | MCI_FROM,(DWORD)&mciPlay);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询