WEEK 12: SOUND
開啟貝殼專案
到WAV下載 下載聲音檔案
聲音程式碼:
///#include <iostream>
///using namespace std;
#include <windows.h>
#include <mmsystem.h>
int main()
{
PlaySoundA("C:\\Users\\user\\Downloads\\lighting.wav", NULL, SND_SYNC);
///cout << "Hello world!" << endl;
return 0;
}
到專案build options 新增winmm
搭配glut可以開視窗播聲音
搭配鍵盤可以播出 do re mi fa so
沒有留言:
張貼留言