gnubeep

Langue: en

Version: 111654 (mandriva - 01/05/08)

Section: 1 (Commandes utilisateur)

NAME

gnubeep - generate custom beeps

SYNOPSIS

gnubeep [OPTIONS]

DESCRIPTION

gnubeep is a simple utility to generate custom tones (beeps). It was intended to be used as a backend in shell scripts (or otherwise) to generate custom beeps where necessary.

OPTIONS

gnubeep has various options:
-h
Output a usage/help message
-b
Generate a beep using the bell character (\a)
-f
<frequency> Frequency of the tone in Hertz (Hz)
-l
<length> Length of the tone in microseconds (ms)

When invoking gnubeep, the -f switch and the -l switch must be used together to specify a desired frequency for the tone and the required duration.

The length of the tone specified with the -l switch should be supplied in MS, not seconds. For example, 1000000 is equal to one second.

EXAMPLES

Here are some example uses of gnubeep:

gnubeep -f 2600 -l 1000000 - plays 2600 Hz tone for 1sec

gnubeep -f 600 -l 10000000 - plays 600 Hz tone for 10secs

gnubeep -b - prints the bell character

Elabourate scripts can be written to use multiple invokations of gnubeep to play a simple tune, such as Jingle Bells.

NOTES

gnubeep programs channel 2 of the system PIT to generate custom tones and beeps using the system's internal speaker (not the sound card). The following calculation is used to program the PIT to generate the desired tone:

divisor = 1193180 / frequency

The result of this calculation is sent to channel 2 of the PIT, a byte at a time (because the value is 1 word), after turning on the system speaker. This causes the speaker to emit the desired tone. After a specified duration (see the -l switch), the speaker is switched off.

Durations specified via the -l switch must be supplied as lengths in microseconds (ms), not seconds (s).

Frequencies specified via the -f switch must be supplied as pitches in hertz (Hz).

gnubeep must be SUID root to allow users other than root to run the program. I don't know of any security-related bugs, and I have checked the code carefully, but you're welcome to audit the code yourself.

More information on the internal speaker and programming the PIT is easily available on the web and in old developer manuals.

AUTHOR

gnubeep was written by Shaun Colley, 09 April 2004

LICENSE

gnubeep is released under the terms and conditions of the GNU General Public License, see the LICENSE file.

This man page is released under the GNU Free Documentation License.

BUGS

No known bugs. Please send bug reports to <shaunige@yahoo.co.uk>