四月 27, 2011

Dev C++播放wav檔

播放wav檔,並可立即執行後續程式,需在Dev C++環境中設定[專案] | [專案選項] | [參數] | 輸入
-lwinmm
| [確定]


#include "windows.h"
#include "conio.h"
#include "stdio.h"

using namespace std;

int main(int argc, char *argv[])
{

PlaySound("C:Windows.0MediaWindows XP 關閉.wav", NULL, SND_FILENAME|SND_ASYNC|SND_LOOP);
// PlaySound("SystemStart", NULL, SND_ASYNC|SND_LOOP );

printf("Play Sound Now.....n");

while (kbhit()==0);

PlaySound(NULL, NULL, SND_FILENAME);
printf("Stop sound !!n");

system("PAUSE");
return EXIT_SUCCESS;
}


Posted by superman at 01:26  迴響 (0)引用 (0)C語言教學

引用URL

http://blog2.cyhs.tp.edu.tw/teacher/trackback.php?id=2755
回應文章