You should avoid speaking or singing when your voice is hoarse.
When your voice is injured or hoarse, you should “rest” your vocal folds, just as you would avoid walking on a sprained ankle. And remember, whispering (instead of speaking) does not rest your vocal folds. If you are hoarse longer than 2-3 weeks, or have a complete loss or severe change in voice lasting longer than a few days, consult an otolaryngologist. Prolonged hoarseness may be a sign of a serious health problem requiring medical treatment.