2.實作:PlaySound(),CMP3_MCI.h
3.鍵盤鋼琴.射擊遊戲
4.複習貼圖+TRRT.下周小考
*音檔
-上網載wav音檔,放入freeglut/bin中
-

*code
-新增 #include <mmsystem.h>
-在int main()函式中新增,PlaySound("檔名.wav",NULL,SND_ASYNC);
-SND_SYNC要等、SND_ASYNC不要等(不同步)
*音檔打不開
-喇叭播放位置不正確
-

-檔案名稱不正確
-取消-隱藏已知檔案類型的副檔名
-

*貝殼專案
-選C
-

#include <stdio.h>
#include <windows.h>
#include <mmsystem.h>
順序很重要
int main()
{
PlaySound("ambul.wav",NULL,SND_SYNC);
printf("Hello world!\n");
return 0;
}
-Build option-Linker settings-新增winmm
-音檔要抓到專案裡





沒有留言:
張貼留言