I have the Droid Razr Maxx (not the HD) and my sound was working fine earlier today, then while at my in-laws for Thanksgiving dinner, it just stopped. No ringtone, no notifications, no sounds on music, youtube - anything. I've been looking online for answers since I got back home and I have rebooted (many times), cleared the cache on the phone, etc. If I take a screenshot, then the next thing I do right after that will have sound, and then it stops again. If it is a video it plays about 5-10 seconds of sound and then stops. What is going on with my phone, and how can I fix it? This is crazy!
Try hard-booting the phone (not just powering down and up again). I haven't owned the RAZR for a few months now since upgrading, so I can't remember how to hard-boot it. But that info is easy enough to find online. It doesn't sound like there was any water damage to the speaker, since the sound works sometimes. If there was water damage, the sound wouldn't work at all. Does your speaker phone work? When I had my RAZR, I had the sound problem that you're having. I hard-booted it, and it worked just fine afterwards.