Some materials like quartz show the piezoelectric effect. When a voltage is applied, the material deforms. The effect works in reverse too. If the material is deformed by an external force, a voltage is produced.

This effect is used to make sounding devices.

Piezo Sounder

If an alternating voltage is applied to the conducting surfaces, the quartz vibrates and sound is produced.

Versions of this device exist with built-in electronics to produce the alternating voltage.

If the simpler version is chosen, you have to build your own astable circuit to produce the alternating voltage.

These sounders are found in Christmas and birthday cards as well as low cost alarm clocks.