Have you done all the usual stuff such as zapping the PRam, running fsck in single user mode, repairing permissions in Disk Utility, creating a new user account and seeing (or hearing as is the case here) if the problem persists?
Apologies for the following, but just in case... The speakers are plugged into the correct sound out mini-jack aren't they... and not the microphone jack?
Here are the few fixes I perform when something is not-quite-right (Unplugging and re-plugging the speakers hasn't worked either I assume):
Running fsck in single user mode
Restart (or start up) > hold down Apple key-S
You should then see a
Black screen with white scrolling text > type the following when the scrolling text finishes:
sbin/fsck -fy
NOTE... there is a space between the k and the hyphen...
and then press return
Allow the computer to run though the checks. When the procedure is finished you may receive a message that no repairs were necessary, or that repairs were successful (I cannot remember the exact phrases).
type: reboot and press return key. Mac will restart
Zapping the PRam
Restart (or start up)> hold down Apple key-option-P-R
Keep these keys held down until you hear the start-up chime three times and then release, and allow the Mac to start up.
You may have to reset your computer clock after this procedure.
Repair Permissions
Open Disk Utility, in the Applications > Utilities folder, and choose Help > Disk Utility Help.
This will provide the necessary information on how to proceed. This is, basically:
In Disk Utility, select the computer's hard drive in the list.
Click First Aid.
Click the Repair Disk Permissions button (there is also a Verify Permissions button).
Now... the Apple Help for Disk Utility does not suggest that you repair permissions twice, but I always do this. I want to see a clean bill of health in the Permissions repair summary.
In fact, I never Verify permissions. I go straight for Repair. I don't see the point of checking something that almost always has something to fix.