Absolutely, if it is at all possible, get word to the hosts. Tell another guest to tell them, or call or text, or leave a message at the venue. Better to take thirty seconds of their time than to have people wondering what happened to you and if you are still coming or even just forgot or blew them off. That is less a waste of their time and distraction than worrying and asking about you and even trying to track you down. As it is so completely rude to just not show up, if someone is missing, people will assume something is terribly wrong and start focussing on that. And as others have said, they may appreciate the info to make seating or other changes.
Obviously, if it's a grave, dire emergency, you don't need to ask the emergency surgeon to hold off for a minute so you can make a phone call.
But the fact that of course emergencies change things doesn't make the whole thing optional. If you can, you do, and as soon as possible.
In most situations, there is an opportunity for someone to make a quick call or text to someone. As a matter of fact, I HAVE called from an emergency room (and yes, I was the patient, albeit not for anything dangerous) to tell someone I might not be able to do something he was counting on me for.
For that matter, the guests themselves might also be less inconvenienced during the crisis by making a call or a text at a good moment than having to take a lot of calls from hosts and guests wondering where they are.
I would certainly understand if someone didn't call because they were dealing with a fire or in an ambulance. And I would certainly understand if someone couldn't attend because they have the flu or got stuck out of town -- but I would be pretty frosted if they didn't even call to tell us and just left us wondering.
Just apologizing after the fact might cause the hosts to wonder if you simply forgot or worse that something better came along. Waiting til the next WEEK to call definitely would.