home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1994 February
/
psl_9403.zip
/
psl_9403
/
DOS
/
UT_SYSTM
/
CENVI2.ZIP
/
SOUND.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-06-23
|
1KB
|
36 lines
EXTPROC CEnvi
/*******************************************************************
*** Sound - Sound a specified frequency for specified number of ***
*** milliseconds (approximate). ***
*******************************************************************/
main(argc,argv)
{
if ( argc != 3 || 0 == (frequency=atol(argv[1])) || 0 == (duration=atol(argv[2])) )
Instructions();
else
DosBeep(frequency,duration)
}
DosBeep(Frequency,Duration) // play specified Frequency, in Hz, for specified
{ // duration, in milliseconds
#define ORD_DOS32BEEP 286
return DynamicLink("doscalls",ORD_DOS32BEEP,BIT32,CDECL,Frequency,Duration)
}
Instructions()
{
printf("\a\n")
printf("Sound - Sound a specified tone on the internal speaker for specified time\n")
printf("\n")
printf("SYNTAX: SOUND Freqency Duration\n")
printf("\n")
printf("Where: Frequency Tone in hertz\n")
printf(" Duration In milliseconds\n")
printf("\n")
printf("The following example would play middle A for 2 seconds:\n");
printf(" SOUND 440 2000\n")
printf("\n")
}