Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
en:docs:fapi:dosbeep [2018/08/25 07:28] – created prokushev | en:docs:fapi:dosbeep [2020/12/06 10:18] – 244 prokushev | ||
---|---|---|---|
Line 9: | Line 9: | ||
==Parameters== | ==Parameters== | ||
* Frequency ([[USHORT]]) - input : Tone in Hertz (cycles per second) in the range 37 through 32767. | * Frequency ([[USHORT]]) - input : Tone in Hertz (cycles per second) in the range 37 through 32767. | ||
- | * Duration (USHORT) - input : Length of the sound in milliseconds. | + | * Duration ([[USHORT]]) - input : Length of the sound in milliseconds. |
==Return Code== | ==Return Code== | ||
- | rc (USHORT) - return | + | rc ([[USHORT]]) - return |
Return code descriptions are: | Return code descriptions are: | ||
* 0 NO_ERROR | * 0 NO_ERROR | ||
Line 22: | Line 22: | ||
==Example Code== | ==Example Code== | ||
===C Binding=== | ===C Binding=== | ||
+ | <code c> | ||
- | | + | #define INCL_DOSPROCESS |
- | + | ||
- | USHORT | + | USHORT |
- | + | ||
- | USHORT | + | USHORT |
- | USHORT | + | USHORT |
- | + | ||
- | USHORT | + | USHORT |
+ | </ | ||
This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1, | This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1, | ||
- | | + | <code c> |
- | #define BEEP_FREQUENCY 1380 | + | #define INCL_DOSPROCESS |
- | #define BEEP_DURATION 1000 | + | #define BEEP_FREQUENCY 1380 |
- | + | #define BEEP_DURATION 1000 | |
- | USHORT | + | |
- | + | ||
- | rc = DosBeep(BEEP_FREQUENCY, | + | |
- | BEEP_DURATION); | + | |
+ | USHORT | ||
+ | |||
+ | rc = DosBeep(BEEP_FREQUENCY, | ||
+ | | ||
+ | </ | ||
===MASM Binding=== | ===MASM Binding=== | ||
+ | <code asm> | ||
+ | EXTRN DosBeep:FAR | ||
+ | INCL_DOSPROCESS | ||
- | EXTRN DosBeep: | + | PUSH |
- | INCL_DOSPROCESS | + | PUSH |
- | + | CALL | |
- | | + | </ |
- | PUSH | + | |
- | CALL | + | |
Returns WORD | Returns WORD | ||
Line 57: | Line 61: | ||
Text based on http:// | Text based on http:// | ||
+ | |||
+ | |||
+ | {{page> | ||