Theres heaps of articles on repairing the Game Boy Color speaker, and you don’t need me to write a completely new one. Just dismantle the unit using a tri-wing and Phillips head screwdriver that you can grab off eBay for cheap, then de-solder the old speaker and replace with a new one.
Take it all apart
One consideration when you purchase your replacement speaker though. I’m not sure if i have been buying bad batches each time but the speaker as pictured below is very hit and miss for me. I’ve had units that have been repaired with no problem. Other units will give me such a low sound output that its better off to sell as a faulty unit.
Crappy speaker on the left. Good speaker on the right
DS Lite vs GameBoy Battery
What i recommend instead is to pickup a Nintendo DS Lite battery. Its a slightly different shape so you will need to put a dent into the plastic cover to get it to fit nicely.
Using a utility knife to put two incisions into the plastic. You can then pop off the plastic with your hands
I’ve bought and used 6 DS speakers so far and they have all worked perfectly in my Game Boys. The output seems to be slightly better than the original speaker in this case as well!