Speakers turn electricity into sound waves you can hear using magnetic fields. A speaker is a transducer; it transduces electricity into air waves you can hear. When current flows into the speaker in one direction, it pulls air in. When current flows in the other direction, it pushes air away. If the speaker receives 260 electrical pulses in a second, it will vibrate the air at the same rate. This creates a sound with about the pitch of middle C, the middle key on a keyboard.
Inside the speaker is a coil and a permanent magnet. The coil creates a temporary magnetic field only when current runs through it. When current is reversed, the coil's magnetic field is also reversed. The permanent magnet creates a constant magnetic field.
When current flows one way through a coil, the magnet and coil magnetically attract, and the coil pulls towards the magnet. When current is reversed, the coil pushes away from the magnet. This coil is attached to a cone. When the coil moves, it moves the cone and pushes and pulls nearby air. Thus, the speaker transduces electrical current into moving air.