Then there is a possibility of it being a hardware issue. When was the last time you remember it working? Can you recall any apps you Installed right before it stopped working, or any changes you made? It sounds as if you're on all stock software, so it shouldn't be anything to do with firmware, or Rom. The only thing I can think of is some app that is interfering, or hardware issue. And since you did factory reset, it doesn't make sense for it to be app interference. Do all other sounds and sound related functions on your phone work?
Sorry I could not be of more help. It may be something hardware related, which would be something to have fixed HTC or replaced under warranty, if you have one.
Sent from my HTC One S using xda app-developers app