生成一个简单音调的蜂鸣器声音
#Include <WinAPI.au3>
_WinAPI_Beep($iFreq = 500, $iDuration = 1000)
$iFreq | 声音的频率(赫兹),此参数必须在 37 到 32,767 范围之间. |
$iDuration | 声音的持续时间(毫秒). Windows Me/98/95: 此参数被忽略. |
成功: | 返回 True |
失败: | 返回 False |
在MSDN中搜索
#include <WinAPI.au3>
_Main()
Func _Main()
Local $iFreqStart = 100
Local $iFreqEnd = 250
MsgBox(4096, "_WinAPI_Beep Example", "Ascending")
For $iFreq = $iFreqStart To $iFreqEnd
_WinAPI_Beep($iFreq, 100)
ToolTip("Frequency = " & $iFreq)
Next
MsgBox(4096, "_WinAPI_Beep Example", "Descending")
For $iFreq = $iFreqEnd To $iFreqStart Step -1
_WinAPI_Beep($iFreq, 100)
ToolTip("Frequency = " & $iFreq)
Next
EndFunc ;==>_Main