2018年5月14日 星期一

八隻八哥八筆記 week12

PlaySound() 函式複習
Step1:
變更cbp檔的glut專案位置

將working-dir的位置改成   "."
並測試

Step2:
加入聲音播放


code:
#include <mmsystem.h>
int main(int argc, char *argv[])
{
    PlaySound("Shot.wav",NULL,SND_ASYNC);


Step3:
使用mp3檔播放
1.先下載CMP3_MCI.h,放入專案檔
2.加入程式


code:

#include "CMP3_MCI.h"
CMP3_MCI myMp3;
int main(int argc, char *argv[])
{
    myMp3.Load("Ariel.mp3");
    myMp3.Play();



Step4:
增加時間計時器


code

void timer(int t)
{
    glutTimerFunc(5000, timer, 0);
    PlaySound("Shot.wav",NULL,SND_ASYNC);
}
.
.
.
glutTimerFunc(3000, timer, 0);
                  ///1000毫秒=1秒

Step5:
內插公式、線性內插 動畫





沒有留言:

張貼留言