It is very likely a failure of your sound card, which happened to my PowerBook G3/300. The cost of replacement was higher than the amount of money I would have received by selling the PowerBook, so I decided to just buy an iBook for the first time. Just pray that the problem you described is not being caused by the sound card, because the problem gets worse until the computer will not even start up any longer. Anyway, take it in to see if it is the sound card, and if it is, unload the computer as fast as you can on an unsuspecting purchaser before it becomes a useless chunk of plastic and metal. I no longer have access to the Apple technicians' database (membership expired), so I can't check to see whether there is another cause. I doubt very much that it would be a loose wire or anything that simple. Sound-related problems seem like minor inconveniences, but the sound card is almost as important as the logic board (I think it was actually part of the motherboard for my PowerBook G3, hence the expense), so it is a much more serious problem that it may initially seem.
I've been buying Apple portables ever since the B&W screen PowerBook 170 came out and have never tried to sell a single one, just using them until they can no longer support the latest OS and essential software, and then trashing them. The same is true for my original iMac. I wonder how many users actually resell their old Macs.