我将函数写了出来
# include <stdio.h>
# include <conio.h>
# include <windows.h>
# include <stdlib.h>
# include <string.h>
# include <io.h>
#pragma comment(lib, "WINMM.LIB")
void MyMusic (char * FileName)
{
char cmd[1024];
sprintf (cmd , "%s%s%s" , "open ", FileName, " type avivideo alias mymusic");
MCIERROR mciError = mciSendStringA(cmd, NULL, 0, 0);
// printf ("%d" , mciError);
if (mciError)
return;
mciSendStringA("play mymusic repeat", NULL, 0, 0);
}
int main (void)
{
char FileName[] = "C:\\Users\\yutang\\Desktop\\1.wav";
MyMusic (FileName);
return 0;
}
这样写没有反应啊
# include <stdio.h>
# include <conio.h>
# include <windows.h>
# include <stdlib.h>
# include <string.h>
# include <io.h>
#pragma comment(lib, "WINMM.LIB")
void MyMusic (char * FileName)
{
char cmd[1024];
sprintf (cmd , "%s%s%s" , "open ", FileName, " type avivideo alias mymusic");
MCIERROR mciError = mciSendStringA(cmd, NULL, 0, 0);
// printf ("%d" , mciError);
if (mciError)
return;
mciSendStringA("play mymusic repeat", NULL, 0, 0);
}
int main (void)
{
char FileName[] = "C:\\Users\\yutang\\Desktop\\1.wav";
MyMusic (FileName);
return 0;
}
这样写没有反应啊
菜鸟一枚,求各位大神多多关照。