AT&T Chat led me through several steps, but none rectified the problem. Before doing a master reset, I am hoping to find another solution. Slapping the phone against my hand will sometimes work, so I believe it's a problem with the speaker connection. I have had the phone for 6 months. No water damage.
I suggest you contact Samsung instead of AT&T. They should know exactly what to do with your phone. They will check and be able to tell what's wrong with your phone's speaker.
You can find contact information from the Samsung page.