Function Reference


_WinAPI_Beep

Generates simple tones on the speaker

#include <WinAPI.au3>
_WinAPI_Beep ( [$iFreq = 500 [, $iDuration = 1000]] )

Parameters

$iFreq [optional] The frequency of the sound, in hertz. This parameter must be in the range 37 through 32,767.
$iDuration [optional] The duration of the sound, in milliseconds. Windows Me/98/95: This parameter is ignored.

Return Value

Success: True
Failure: False

Remarks

Muting and volume control have no effect on Beep. You will still hear the tone.

See Also

Search Beep in MSDN Library.

Example

#include <MsgBoxConstants.au3>
#include <WinAPI.au3>

Example()

Func Example()
    Local $iFreqStart = 100
    Local $iFreqEnd = 250

    MsgBox($MB_SYSTEMMODAL, "_WinAPI_Beep Example", "Ascending")

    For $iFreq = $iFreqStart To $iFreqEnd
        _WinAPI_Beep($iFreq, 100)
        ToolTip("Frequency = " & $iFreq)
    Next

    MsgBox($MB_SYSTEMMODAL, "_WinAPI_Beep Example", "Descending")

    For $iFreq = $iFreqEnd To $iFreqStart Step -1
        _WinAPI_Beep($iFreq, 100)
        ToolTip("Frequency = " & $iFreq)
    Next
EndFunc   ;==>Example