Hello
Our voice, though formed in our voice box,  is modified as it passes through our Nose and 
Sinuses. SO , if you have a bad 
cold , it will change the voice 
Medical treatment for your cold would be helpful , when it flairs up
At present though , you don't have a cold and based on the information you gave, this problem sounds like 
Laryngitis.
This is an inflammation of your voice box, which can occur because of many reasons - infection , 
smoking , excessive acidity etc.
This problem can increase because of poor hydration , and excessive voice usage
So the first step is to increase water intake , don't smoke , give your voice rest ( speak sparingly and don't whisper or shout )
If the problem persists you need to visit an ENT doctor ( preferably who specialises in voice problems ) 
You may get a 
laryngoscopy done ( a camera examination of you voice box ) to confirm the problem and start the appropriate treatment
Thank you