How to add a beep to your C++ program
Note: The beep library was written at Carleton College for use by Carleton Students.
To make a c++ program beep, add beep.h to the list of included header files, and use the "beep" library call.
USAGE: beep(pitch,length) where pitch is the desired tone in Hz, and length is the desired duration in milliseconds
Compile with the the following syntax:
g++ -o file file.cpp -L/usr/X11R6/lib -lbeep -lm -lX11
Here is an example program:
#include <iostream.h>
#include <beep.h>
void main(void)
{
beep(3000,1000);
beep(900,1000);
}
- CS Mini Courses
- go.carleton.edu/lynda
- Installing Python On Your Home Computer
- PIL (Python Imaging Library) for Python 2.x
- Installing Java on your home computer
- Setting your Java CLASSPATH variable
- Java Documentation
- Scanner class
- TeX and LaTeX
- Running programs in the background
- Compiling in Linux
- Beep Program
- Makefiles
- Keyboard Interrupts
- Installing Cygwin







