Beep函數實現硬件蜂鳴聲

 1 #include <Windows.h>
 2 #include <tchar.h>
 3 
 4 int WINAPI _tWinMain(HINSTANCE hInstance,
 5                      HINSTANCE hPrevInstance,
 6                      LPTSTR lpCmdLine,
 7                      int nCmdShow) 
 8 {
 9     Beep(750,300);//硬件蜂鳴聲
10 
11     //第一個參數:聲音的頻率,以赫茲爲單位。此參數必須在37到32767(0x25到0x7FFF)範圍內。
12     //第二個參數:聲音的持續時間,以毫秒爲單位。
13 
14     return 0;
15 }
相關文章
相關標籤/搜索