I faced this shit yesterday. And let me explain how it happened to me.
The phone was connected to my car audio system via Bluetooth. Then I made a call using viber. I can hear the other person but apparently they're having difficulties hearing me. So I decided to use the earpiece instead. Then I realised viber doesn't have that option. So I ended the call, disconnect bluetooth, and call using viber again. Now I can't hear anything.
Then I call using GSM coz I thought maybe viber has gone crazy again. Still everything was silent. I rebooted the phone, made a call again, still the same. I tried to calm myself down, then tried to make a voice message via whatsapp and it's not working. So it's like everything involving the mic doesn't work. I proceed to listen a song via Spotify. No sound. I adjust the volume where you are supposed to hear the beep but, no sound. So now I know everything involved with speaker and mic, are not working. I reboot again but to no avail.
At this point I was so full of regret for not making a nandroid backup. Before I decided to restock the phone, I felt like I should reconnect the phone to the car audio system via Bluetooth again, just coz I feel like it. To my surprise, I can listen to spotify. I tried to make a call again and it's working normally. And so is whatsapp voice message. But I dare not to test viber at that time, hehe.
So I disconnect the bluetooth, and test everything again and all is fine now. I was so relieved but I was not satisfied coz I don't know what caused the craziness and what solved the problem. To me it was a mere luck.
I think you better do hard reset like johnkor did to fully solve it else it sure will come back again.