When you want to make a sound, you exhale and simultaneously a pair of vocal cords, left and right, narrow the passage for the air you are pushing out of your lungs.
The flow of air trapped in between and through the narrow passage accelerates and makes your vocal cords vibrate. Failure at any stage of this mechanism leads to hoarseness. Hoarseness over 1 week must be examined. It should be kept in mind that hoarseness over 3 weeks may be a harbinger of dangerous diseases.