Please excuse a simplistic question, but you mentioned having checked "the system" without mentioning that you took a look in /Applications/System Preferences > Sound to ensure that your volume hasn't simply turned itself off (as has been known to happen).
And since I'm here... Which specific iMac, which version of OS X, and are both your internal and external sound non-functional?