home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / SOUND.CMD < prev    next >
OS/2 REXX Batch file  |  1994-11-28  |  1KB  |  44 lines

  1. EXTPROC CEnvi2
  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. //DosBeepGate(Frequency,Duration)
  22. //{
  23. //   #define DOS16BEEP_GATE 0x1692
  24. //   rc = DynamicLink(DOS16BEEP_GATE,BIT16,PASCAL,
  25. //                    Frequency,Duration);
  26. //   printf("rc = %08X\n",rc);
  27. //}
  28.  
  29. Instructions()
  30. {
  31.    printf("\a\n")
  32.    printf("Sound - Sound a specified tone on the internal speaker for specified time\n")
  33.    printf("\n")
  34.    printf("SYNTAX:  SOUND Freqency Duration\n")
  35.    printf("\n")
  36.    printf("Where:  Frequency     Tone in hertz\n")
  37.    printf("        Duration      In milliseconds\n")
  38.    printf("\n")
  39.    printf("The following example would play middle A for 2 seconds:\n");
  40.    printf("    SOUND 440 2000\n")
  41.    printf("\n")
  42. }
  43.  
  44.