Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:docs:fapi:dosbeep [2018/08/25 15:00] – [DosBeep] prokushev | en:docs:fapi:dosbeep [2021/09/17 03:37] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{logos:os2.gif? | + | {{page>en:templates:fapiint}} | 
| ====== DosBeep ====== | ====== DosBeep ====== | ||
| This call generates sound from the speaker. | This call generates sound from the speaker. | ||
| - | ==Syntax== | + | ===== Syntax | 
| - |  | + | |
| + | <code c> | ||
| + |  | ||
| + | </ | ||
| + | |||
| + | ===== 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 | ||
| *395 ERROR_INVALID_FREQUENCY | *395 ERROR_INVALID_FREQUENCY | ||
| - | ==Remarks== | + | ===== Notes ===== | 
| + | |||
| DosBeep executes synchronously. An application program that invokes DosBeep waits until the specified number of milliseconds expire before it resumes execution. | DosBeep executes synchronously. An application program that invokes DosBeep waits until the specified number of milliseconds expire before it resumes execution. | ||
| - | ==Example Code== | + | ===== Example Code ===== | 
| - | ===C Binding=== | + | |
| - | #define INCL_DOSPROCESS | + | ==== C Binding ==== | 
| - | + | ||
| - | USHORT | + | |
| - | + | ||
| - | USHORT | + | |
| - | USHORT | + | |
| - | + | ||
| - | USHORT | + | |
| - | This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1, | + | <code c> | 
| - |  | + | #define INCL_DOSPROCESS | 
| - | #define BEEP_FREQUENCY 1380 | + | |
| - | #define BEEP_DURATION 1000 | + | |
| - | + | ||
| - | USHORT | + | |
| - | + | ||
| - | rc = DosBeep(BEEP_FREQUENCY, | + | |
| - | BEEP_DURATION); | + | |
| - | ===MASM Binding=== | + | USHORT | 
| - |  | + | USHORT | 
| - | INCL_DOSPROCESS | + | USHORT | 
| - | + | ||
| - | PUSH | + | USHORT | 
| - | PUSH | + | </ | 
| - | CALL | + | |
| + | ==== MASM Binding ==== | ||
| + | |||
| + | <code asm> | ||
| + | EXTRN  DosBeep: | ||
| + | INCL_DOSPROCESS | ||
| + | |||
| + | PUSH | ||
| + | PUSH | ||
| + | CALL | ||
| + | </ | ||
| Returns WORD | Returns WORD | ||
| - | === Note === | + | ==== Example ==== | 
| + | |||
| + | This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1,380. | ||
| + | |||
| + | <code c> | ||
| + | #define INCL_DOSPROCESS | ||
| + | #define BEEP_FREQUENCY 1380 | ||
| + | #define BEEP_DURATION 1000 | ||
| + | |||
| + | USHORT | ||
| + | |||
| + | rc = DosBeep(BEEP_FREQUENCY, | ||
| + |  | ||
| + | </ | ||
| + | |||
| + | ===== Note ===== | ||
| Text based on http:// | Text based on http:// | ||




