如何mic循环小弟在此求教
#include <windows.h>#include <mmsystem.h>
#include <commctrl.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#pragma comment(lib, "winmm.lib")
int main()
{
char buf[50] = {0}; //存放错误信息
char cmd[100] = "open \"e:\\xx\\xx.mp3\" alias aa_music"; //这里xx是音乐文件路径
MCIERROR mciError;
int mp3_alltime = 0; mciError = mciSendString(cmd, buf, 50, NULL);
if (mciError)
{
printf("%s err1 \n", buf);
return 1;
}
//设置音量
mciSendString("setaudio aa_music to 500", NULL, 0, 0);
//播放音乐
mciError = mciSendString("play aa_music",NULL,0,NULL); //Play music
if (mciError)
{
printf("%s err2 \n", buf);
}
//获取该mp3文件的播放时间
char sPosition[256]; //存取当前播放音乐的总时间
mciSendString("status aa_music length",sPosition,255,0); mp3_alltime = atol(sPosition);
Sleep(mp3_alltime); //这个主要是起到让程序不会挂起,要不然直接结束了。
return 0;
}
网上查到是 play aa_music repeat
可是不行,各位大神告诉我下,应该怎么才能循环播放