Sound waves are created by the vibration of an object, in this case with a hanger. When vibrations hit your eardrum, your brain interprets the vibrations as sound. The sound waves can travel through air, liquids and solids. When we listen to the hanger hit the wall with the string to our ears, the sound waves are traveling through the solid string and hanger. Since sound waves travel more quickly through solids, we hear the sound more clearly. When we bang the hanger without putting the string to our ears, the sound waves are traveling through air to get to our ears making the sound more quiet.