Monday, September 15, 2008

WIN 32 API -BEEP

Beep Function
Declaration
long Beep(DWORD dwFreq,DWORD dwDuration)
Platforms
· Windows 95: Supported.
· Windows 98: Supported.
· Windows NT: Requires Windows NT 3.1 or later.
· Windows 2000: Supported.
· Windows CE: Not Supported.
Description & Usage
Beep plays a sound, but its exact behavior varies between platforms. Windows 95/98:
The function always plays the SystemDefault system sound, regardless of the values
passed to the function. Windows NT/2000: The function plays a tone through the
computer's internal speaker at the desired frequency for a specified duration.
Return Value
If an error occured, the function returns 0 (use GetLastError to get the error code). If
successful, the function returns a non-zero value.
Parameters
dwFreq
Windows NT/2000: The frequency, in hertz (Hz), of the tone to play. Windows
95/98: Ignored.
dwDuration
Windows NT/2000: The duration, in milliseconds, to play the desired tone.
Windows 95/98: Ignored.
Example(C)
// Attempt to play a note at 800 Hz for 2 seconds. This will only
// behave this way on Windows NT/2000; users of Windows 95/98 will only
hear the
// default sound.
long retval; // return value
retval=Beep(800,2000); // ideally, an 800 Hz tone for 2 seconds

No comments:

Just Answer


JustAnswer.com