The motor effect is used inside headphones, which contain small loudspeakers. In these devices, variations in an electric current cause variations in the magnetic field produced by an electromagnet. This causes a cone to move, which creates pressure variations in the air and forms sound waves.
Figure caption,
A loudspeaker converts electrical signals into sound waves
Alternating current supplied to the loudspeaker creates sound waves in the following way:
a current in the coil creates an electromagnetic field
the electromagnetic field interacts with the permanent magnet generating a force, which pushes the cone outwards
the current is made to flow in the opposite direction
the direction of the electromagnetic field reverses
the force on the cone now pulls it back in
repeatedly alternating the current direction makes the cone vibrate in and out
the cone vibrations cause pressure variations in the air, which are sound waves
To make a loudspeaker cone vibrate correctly, the electric current must vary in the same way as the desired sound.