dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosBeep (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSPROCESS
 
USHORT DosBeep(usFrequency, usDuration)
USHORT usFrequency;    /* frequency in hertz       */
USHORT usDuration;     /* duration in milliseconds */
 
The DosBeep function generates sound from the speaker.
 
The DosBeep function is a family API function.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
usFrequency  Specifies the frequency of the sound in hertz
             (cycles-per-second). This parameter can be any value from
             0x0025 through 0x7FFF.
 
usDuration   Specifies the length of the sound in milliseconds.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be the following:
 
     ERROR_INVALID_FREQUENCY
 
Example
 
This example calls the DosBeep function and produces audible tones:
 
SHORT i;
for (i = 0; i < 10; i++) {
    DosBeep(600, 175);
    DosBeep(1200, 175);
}
 
See Also
 
WinAlarm