There are two reasons for this problem. Either the sound chip has failed or this is a glitch with system.
First reset the System Management Controller of your Mac. Follow the steps below;
Shut down the computer.
Plug in the power adapter to a power source, connecting it to the Mac if not already connected.
On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
Release all the keys and the power button at the same time.
Press the power button to turn on the computer.
If that didn't work,then reset the PRAM and NVRAM of your Mac. Follow the steps below;
Shut down your Mac
Restart and immediately hold down Command-Option-P-R keys at the same time
Hold the keys down until the computer restarts and you hear the startup sound for two or three times.
Release the keys and let the Mac bootup.
Please let me know if that didn't work, so we can continue troubleshooting.
Note : This is not my final answer. I strive to provide Excellent service or 5 star service. If you feel you've received anything less or if you are not satisfied or if my solutions didn't work, please don't rate me bad or poor or ok. Instead, please let me know and I will try my best to help you until you are fully satisfied or the issue is resolved.