求视频:用vc++6.0编写MP3播放器的代码,急!!
1个回答
展开全部
放一个1.mp3在文件夹里面
#include "stdafx.h"
#include <graphics.h>
#include <conio.h>
#include <windows.h>
#pragma comment(lib,"Winmm.lib")
void main()
{
initgraph(640, 480);
mciSendString("open 1.mp3 alias mymusic", NULL, 0, NULL);
outtextxy(0, 0, "按任意键开始播放");
getch();
mciSendString("play mymusic", NULL, 0, NULL);
outtextxy(0, 0, "按任意键停止播放");
getch();
mciSendString("stop mymusic", NULL, 0, NULL);
mciSendString("close mymusic", NULL, 0, NULL);
outtextxy(0, 0, "按任意键退出程序");
getch();
closegraph();
}
#include "stdafx.h"
#include <graphics.h>
#include <conio.h>
#include <windows.h>
#pragma comment(lib,"Winmm.lib")
void main()
{
initgraph(640, 480);
mciSendString("open 1.mp3 alias mymusic", NULL, 0, NULL);
outtextxy(0, 0, "按任意键开始播放");
getch();
mciSendString("play mymusic", NULL, 0, NULL);
outtextxy(0, 0, "按任意键停止播放");
getch();
mciSendString("stop mymusic", NULL, 0, NULL);
mciSendString("close mymusic", NULL, 0, NULL);
outtextxy(0, 0, "按任意键退出程序");
getch();
closegraph();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询