//播放Wav声音
//把a.wav文件放到c盘目录下
#include "mmsystem.h"
void __fastcall TForm1::Button1Click(TObject *Sender)
{
PlaySound("c:\\a.wav",NULL,SND_ASYNC);
}
//播放res里的Wav
/*aaa WAVE A.WAV //sounderes*/
#include "mmsystem.h"
#pragma resource "soundres.RES"
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// PlaySound( "aaa",HInstance,SND_RESOURCE|SND_ASYNC);/*C++builder 6.0*/
#include "mmsystem.h"
#pragma resource "soundres.RES"
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// PlaySound( "aaa",HInstance,SND_RESOURCE|SND_ASYNC);/*C++builder 6.0*/
PlaySound( "aaa",HInstance,SND_RESOURCE);/*C++builder 6.0*/
PlaySound(TEXT("aaa"),HInstance,SND_RESOURCE);/*C++ builder xe2*/
}
}
循环播放
把playSound事件放在Timer下面即可