[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project

DosBeep

[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]

Syntax

rc = DosBeep( ulFrequency, ulDuration );

Parameters

ULONG ulFrequency (input)
The frequency in Hertz (Hz) of the beep to be generated. In the range of 0x25 to 0x7FFF (37 to 32767).
ULONG ulDuration (input)
The duration of the beep to be generated. In milliseconds.

Returns

APIRET  rc
0       NO_ERROR
395     ERROR_INVALID_FREQUENCY

Include Info

#define INCL_DOSPROCESS
#include <os2.h>

Usage Explanation

To produce a beep from the speaker DosBeep is called with the frequency and the length of the beep as arguments.

Relevant Structures

Gotchas

Sample Code

#define INCL_DOSPROCESS #include <os2.h> #include <stdio.h> /* For printf */ if(DosBeep(400, 300)) /* Beep a 400 Hz tone for 0.3 seconds */ { printf("Invalid frequency to DosBeep()\n"); /* In case of error, should not */ } /* be called now when the */ /* frequency is 400 Hz */

See Also

Author

Oscar Gustafsson - oscar@lysator.liu.se

Additions

Last modified September 21/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project

DosBeep