예제 #1
0
파일: MP3.C 프로젝트: nguyenngodinh/cs-doc
void main()
{
    void main()
    {
        //MP3 Player
        /*初始化*/
        MP3player_Init(); //解码器初始化
        Mutestate(1);//初始化为声状态
        P1 = 0x0f;
        KBCON = 0x00;
        IEN1 |=EKB;	  //按键初始化
        EA = 1;      //中断使能
        /*获得曲目数量*/
        Number_Song = GetMP3NUM();
        /*处理播放曲目程序*/
        Playingflag= 0;
        while(1) //循环
        {
            if(Number_Song != 0)//如果存在MP3文件
            {
                PlayInit(&SONG[11 * Playingflag]);
                Mutestate(0);//有声模式
                PlayMP3(&SONG[11 * Playingflag]);//播放指定MP3文件
                Mutestate(1);
            }
            if(Playingflag ==Number_Song)//循环播放
            {
                Playingflag= 0;
            }
        }
    }
예제 #2
0
파일: JSfx.cpp 프로젝트: DrakonPL/jge
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
{

	if (music->mTrack)
		PlayMP3(music->mTrack, looping);
}