把音频文件放在工程当前目录下,下面代码便可实现音频播放。
#include "stdafx.h"
#include <windows.h>
#include <mmsystem.h>
#include <conio.h>
#pragma comment(lib,"winmm.lib")
int main(int argc, char* argv[])
{
PlaySound("019.wav", NULL,!SND_SYNC|SND_LOOP );
getch();
return 0;
}