Speakers are used to turn electrical impulses into sound. In a permanent magnet speaker, it is composed of a coil of wire, called the voice coil, that is attached to a moveable piece of paper or plastic, called the cone, which is put in a magnetic field from a permanent magnet. In an electrodynamic speaker the permanent magnet is replaced with a field coil. When a current runs through the voice coil, it creates a magnetic force which in the magnetic field of the permanent magnet or field coil, creates motor action. This motor action causes the coil to move the cone, to create the vibrations for sound.
Another type of speaker called the electrostatic speaker, which is usually used for high frequencies, is composed of two plates much like a capacitor, one of which is flexable. The cone is attached to the flexable plate, which will move when a high voltage is applied to the plates.
But speakers are also sometimes used as a microphone. When the speaker picks up vibrations, it acts in much the same way as a generator and moves the coil of wire in the magnetic field, which produces a small electric potential.
Some permanent magnet speakers are shown above. These are found in many devices, and can be much larger than the ones shown here, and are often used as the woofer in stereos.