A speaker is an output device. It has a diaphragm which is a thin layer of paper or plastic. The diaphragm is attached to a coil which in turn is surrounded by a permanent magnet. The computer stores a sound wave as a set of bits. When the computer is generating a sound, it uses that sound’s stored bits to generate the corresponding electrical signal and send it to the speaker coil. With the current flowing in it, the coil becomes an electromagnet. As the current amplitude changes sign, the current reverses direction and this in turn reverses the polar orientation of the electromagnet. The final result is that the actions of repulsion and attraction between the electromagnet and the permanent magnet also reverse direction and this pushes the coil back and forth. This vibrates the diaphragm creating the sound that we hear.
A microphone is an input device. It is the reverse of a speaker. It works like our ears. It has a diaphragm that acts as an eardrum. A sound wave vibrates the diaphragm and these vibrations are converted into an electrical signal that is stored into the computer as a set of bits. Speakers and microphones are typically connected to the computer through the ports of a dedicated sound board that is inserted into a motherboard slot. |