home *** CD-ROM | disk | FTP | other *** search
- // Sound Module
- // M\Cooper, PO Box 237, St. David, AZ 85630-0237
- // E-mail: thegrendel@theriver.com
- // Web: http://personal.riverusers.com/~thegrendel/
-
-
- #include <dos.h>
-
-
- #define FREQ 900
- #define DELAY 100
-
- void beep1( void ),
- beep2( void );
-
- /***************************************************************************/
- /* BEEPS */
- /***************************************************************************/
-
- void beep1()
- {
- sound( FREQ );
- delay( DELAY );
- nosound();
- return;
- }
-
- void beep2()
- {
- beep1();
- delay( DELAY / 2 );
- beep1();
- return;
- }
-
- /**********************************TONE***********************************/
- /* Produces tone at frequency, duration (of sound) */
- /* Arguments in: freq [in Hz], dur [duration in millisec.] */
- /*************************************************************************/
-
- void tone( int freq, int dur )
- {
- sound( freq );
- delay( dur );
- nosound();
- return;
- }
-
- /**************************************************************************/
- /* Produces a "two-tone" sound (beep-boop) */
- /**************************************************************************/
- void two_tone()
-
- {
- int frequency,
- duration;
-
- frequency = 700;
- duration = 165;
- tone( frequency, duration );
-
- frequency = 450;
- duration = 110;
- tone( frequency, duration );
-
- }
-
-
-
- /**************************************************************************/
- /* BELL */
- /* Produces a succession of 'beep' tones */
- /* Takes 'times' as argument [# of times to beep] */
- /**************************************************************************/
-
- void bell( int times )
-
- {
- while( times-- )
- {
- tone(380,165);
- delay (20 );
- }
- return;
- }
-
- /**************************************************************************/
- /* BLATT */
- /* Produces a "Bronx Cheer" */
- /* [use with error routine] */
- /**************************************************************************/
-
- void blatt()
-
- {
- tone( 42,330 );
- tone(34,220);
- return;
- }
-
-