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 [2020/12/06 10:18] – 244 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:
Line 17: Line 23:
   *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===+ 
 +==== C Binding ===
 <code c> <code c>
  
Line 33: Line 42:
 USHORT  rc;            /* return code */ USHORT  rc;            /* return code */
 </code> </code>
 +
 +==== 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
 +
 +==== Example ====
  
 This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1,380.  This example generates a beep for 1 second (1,000 milliseconds) at a frequency of 1,380. 
Line 46: Line 70:
              BEEP_DURATION);              BEEP_DURATION);
 </code> </code>
-===MASM Binding=== 
-<code asm> 
-EXTRN  DosBeep:FAR 
-INCL_DOSPROCESS     EQU 1 
  
-PUSH   WORD    Frequency     ;Frequency (in Hertz) +===== Note =====
-PUSH   WORD    Duration      ;Length of sound (in milliseconds) +
-CALL   DosBeep +
-</code> +
- +
-Returns WORD+
  
-=== 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