PC speaker
A PC speaker is a loudspeaker built into most IBM PC compatible computers. The first IBM Personal Computer, model 5150, employed a standard 2.25 inch magnetic driven speaker. More recent computers use a piezoelectric speaker instead. The speaker allows software and firmware to provide auditory feedback to a user, such as to report a hardware fault. A PC speaker generates waveforms using the programmable interval timer.
Usage
BIOS error codes
The PC speaker is generally the first output device to be activated during the boot process. Since it is active before the graphics card, it can be used to communicate error codes related to problems that prevent the much more complex initialization of the graphics card to take place. For example, the Video BIOS usually cannot activate a graphics card unless working RAM is present in the system, while beeping the speaker is doable with just ROM and the CPU registers. Usually, different error codes will be signaled by specific beeping patterns, such as e.g. "one beep; pause; three beeps; pause; repeat". These patterns are motherboard specific and are usually documented in the technical manual of the motherboard.