When we speak, our voice vibrates the air molecules and this vibration propagates through the air and hits the diaphragm of the microphone. Then the coil inside the microphone also starts its vibration in a stationary magnetic field. So, an emf is generated in the coil and then it is processed by computers and thus, mechanical energy is converted into the electrical energy.