Nowadays, almost every kid has a computer, whether it's their own or not. And, with that computer, nearly every kid listens to some type of video, music, or even alert messages. Without sound, computers just wouldn't be as useful. But how do computers make sound?
The answer is quite complicated. Older computers used the common magnetic speaker, which included some array of copper wires and an iron magnet. The original design was a simple iron magnet inside a copper coil, vibrated by the electric field induced inside.
Nowadays almost all computers use piezoelectric speakers. This type of speaker is named after the piezoelectric effect, which describes the quality of certain materials to create an internal electric charge due to mechanical stress. A voltage is supplied to a resonator or diaphragm, which in turn begins to vibrate as the electricity causes stress in the object, reversing this effect. The sound of the speaker is controlled by a process called pulse-width modulation. This means that the power supplied to the speaker is digital, either 0V or 5V. However, by adjusting the duration of the duty cycle (the amount of time it gets 5V) different sounds can be created.
Lots of ingenuity went into those tiny little buzzers you listen to every day. So take some time and really enjoy them. Some robot is slaving away making them right now.