Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

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

Section: 1 (Commandes utilisateur)


gnubeep - generate custom beeps


gnubeep [OPTIONS]


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.


gnubeep has various options:
Output a usage/help message
Generate a beep using the bell character (\a)
<frequency> Frequency of the tone in Hertz (Hz)
<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.


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.


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.


gnubeep was written by Shaun Colley, 09 April 2004


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.


No known bugs. Please send bug reports to <>
Demandez à un crapaud ce que c'est la beauté : il vous répondra que
c'est sa crapaude avec deux gros yeux ronds sortant de sa petite tête.
Interrogez le diable il vous dira que le beau est une paire de cornes,
quatre friffes et une queue.
-+- Voltaire, Dictionnaire philosophique -+-