This is called electromagnetic induction close electromagnetic ... the electric current must vary in the same way as the desired sound. Relays are electronically operated switches.