1 |
On Wednesday, April 15, 2015 12:25:03 AM lee wrote: |
2 |
> |
3 |
> Hi, |
4 |
> |
5 |
> when the pcspkr module (or how it's called; I haven't compiled atm) is |
6 |
> loaded, somehow the built-in speaker is used to sometimes beep. There |
7 |
> also seems to be the option to play this beep via the sound card --- |
8 |
> which usually sounds nicer. |
9 |
> |
10 |
> How is this done? Do I need to load a different module for that, or |
11 |
> does it require to use some sort of additional software? |
12 |
|
13 |
If you mean how to configure the kernel for it then just load the right module. |
14 |
I remember seeing a "PC Speaker Emulation" or similar module but I can't find |
15 |
it now so it may be gone. |
16 |
|
17 |
Anyways, this only applies to the console (VT). Software just writes the BEL |
18 |
character (0x07) to it's terminal (stdout) to play a beep. You can also open |
19 |
"/dev/console" directly and play this character or use ioctl calls to play |
20 |
sounds with different frequencies and duration but this requires root |
21 |
privileges. Modern desktop terminal emulators will already be using the sound |
22 |
card to play the BEL character. On KDE for example you can choose any sound |
23 |
file to play or just show a notification. |
24 |
|
25 |
-- |
26 |
Fernando Rodriguez |