TRT小考
MP3播放複習
<New>計時器 Timer
內插 線性內插 動畫
------------------------------------------------
PlaySound();
1.叫出一個GLUT專案然後把CodeBlocks project.cbp改NotePad++改動(working-dir改成".")
2.把freeglut\bin\freeglut32.dll複製到專案目錄
3.moodle載CMP3_MCI.h放到專案目錄(要播的MP3檔也是)
程式碼加入#include<mmsystem.h>
#include"CMP3_MCI.h"
CMP3_MCI myMP3;
int main(int argc, char *argv[])
{
myMP3.Load("123.mp3");
myMP3.Play();
(MP3檔可以在youtube載 網址youtube->youtubeto)
-----------------------------------------------------------------------
計時器
void timer(int t)
{
glutTimerFunc(6000,timer,0);///每多久延遲後播放一次
PlaySound("DUN.wav",NULL,SND_ASYNC);
}
glutTimerFunc(6000,timer,0);///第一次播放延遲
-------------------------------------------------------------------------
內插
內插公式 新xa+舊x(1-a)<a=0~1>

沒有留言:
張貼留言