en:docs:fapi:dosbeep

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:docs:fapi:dosbeep [2018/08/25 15:00] – [DosBeep] prokusheven:docs:fapi:dosbeep [2021/09/17 03:37] (current) prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{page>en:templates:fapiint}} 
 ====== DosBeep ====== ====== DosBeep ======
  
 This call generates sound from the speaker. This call generates sound from the speaker.
  
-==Syntax== +===== Syntax ===== 
- DosBeep (Frequency, Duration)+ 
 +<code c> 
 +  DosBeep (Frequency, Duration) 
 +</code> 
 + 
 +===== 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  rc DosBeep(Frequency, Duration); +
-   +
-  USHORT  Frequency;     /* Hertz (Hz) */ +
-  USHORT  Duration;      /* Length of sound */ +
-   +
-  USHORT  rc;            /* return code */+
  
-This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1,380. +<code c>
  
-  #define INCL_DOSPROCESS +#define INCL_DOSPROCESS
-  #define BEEP_FREQUENCY 1380 +
-  #define BEEP_DURATION 1000 +
-   +
-  USHORT  rc; +
-   +
-  rc = DosBeep(BEEP_FREQUENCY, +
-              BEEP_DURATION);+
  
-===MASM Binding===+USHORT  rc DosBeep(Frequency, Duration);
  
-  EXTRN  DosBeep:FAR +USHORT  Frequency;     /* Hertz (Hz) */ 
-  INCL_DOSPROCESS     EQU 1 +USHORT  Duration;      /* Length of sound */ 
-   + 
-  PUSH   WORD    Frequency     ;Frequency (in Hertz) +USHORT  rc;            /* return code */ 
-  PUSH   WORD    Duration      ;Length of sound (in milliseconds) +</code> 
-  CALL   DosBeep+ 
 +==== MASM Binding ==== 
 + 
 +<code asm> 
 +EXTRN  DosBeep:FAR 
 +INCL_DOSPROCESS     EQU 1 
 + 
 +PUSH   WORD    Frequency     ;Frequency (in Hertz) 
 +PUSH   WORD    Duration      ;Length of sound (in milliseconds) 
 +CALL   DosBeep 
 +</code>
  
 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; 
 + 
 +rc = DosBeep(BEEP_FREQUENCY, 
 +             BEEP_DURATION); 
 +</code> 
 + 
 +===== Note ===== 
  
 Text based on http://www.edm2.com/index.php/OS2_API:CPI:LEGACY:DosBeep Text based on http://www.edm2.com/index.php/OS2_API:CPI:LEGACY:DosBeep