home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / cenvi29.zip / SOUND.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  1KB  |  36 lines

  1. EXTPROC CEnvi
  2. /*******************************************************************
  3.  *** Sound - Sound a specified frequency for specified number of ***
  4.  *** ver.1   milliseconds (approximate).                         ***
  5.  *******************************************************************/
  6.  
  7. main(argc,argv)
  8. {
  9.    if ( argc != 3 || 0 == (frequency=atol(argv[1])) || 0 == (duration=atol(argv[2])) )
  10.       Instructions();
  11.    else
  12.       DosBeep(frequency,duration)
  13. }
  14.  
  15. DosBeep(Frequency,Duration)   // play specified Frequency, in Hz, for specified
  16. {                             // duration, in milliseconds
  17.    #define ORD_DOS32BEEP   286
  18.    return DynamicLink("doscalls",ORD_DOS32BEEP,BIT32,CDECL,Frequency,Duration)
  19. }
  20.  
  21. Instructions()
  22. {
  23.    printf("\a\n")
  24.    printf("Sound - Sound a specified tone on the internal speaker for specified time\n")
  25.    printf("\n")
  26.    printf("SYNTAX:  SOUND Freqency Duration\n")
  27.    printf("\n")
  28.    printf("Where:  Frequency     Tone in hertz\n")
  29.    printf("        Duration      In milliseconds\n")
  30.    printf("\n")
  31.    printf("The following example would play middle A for 2 seconds:\n");
  32.    printf("    SOUND 440 2000\n")
  33.    printf("\n")
  34. }
  35.  
  36.