I was trying to figure out how to do this for a very long time when I finally figured it out by piecing together different pieces of information I found in many different instructions. This helped me a lot and I hope it helps you with all of your speaker projects!
You Will Need:
A speaker (I got mine by taking apart an old computer speaker)
A pair of iPod earbud thingies you don't want back
A soldering iron or a bunch of electrical tape (I used the electrical tape but soldering would probably be preferable)
A wire stripper (you can use scissors for this if you don't have one).
Step 1: The Earbuds
Take your earbuds and cut the wire right below where they split, so you have a plain cord with a jack on the end and a split cord with the earbuds on it. Take the plain cord with the jack and strip about an inch of the insulation off the end without the jack. There will be four separate wires, a copper, a red, a green, and a red and green striped one. Burn off the colored insulation on these wires by setting them on fire individually using a small lighter or match. The flame should catch, burn off the insulation, and burn out quickly. Do this to each of the wires, making sure you can identify their original colors still (leave a bit of the color at the base so you can tell). Set this aside and grab your speaker.
Step 2: The Speaker
Now you will need to take the speaker out of its container. If you're using an old computer speaker like I am, you will need to take out the batteries before removing the speaker! You'll need to unscrew all of the screws you can find and open up the container, which will reveal the bare speaker. unscrew it if you have to.
Cut the wires connecting the speaker to the container and the rest of the circuitry as closely as you can, so the wires still connected to the speaker are as long as they can be. As in my picture, one will usually be black and the other blue. Strip the ends of each of the wires about 3/4 of an inch back. There will be many little copper wires twisted into one if your speaker is like mine. There will be labels on the back where the wires are soldered on saying which wire is negative and which is positive.
Step 3: Putting Them Together
Now you need to go back to the headphones. On your wire, pinch together the copper wire and the red and green striped wire. Add the blue wire, or the positive wire, into this bunch from the other direction, and if you're using tape, make it so that each wire has about a half centimeter of wire left over past the insulation on the other wire. Wrap electrical tape around them thoroughly enough so that the least amount of wire possible is uncovered. Take the bits of too-long wire you left out of the top, over the other wires insulation and fold it over and tape it again. This will make sure the tape doesn't slide down the wires.
Do the same with the red and green wires on the headphones and the negative, or black, wire on the speaker. If you're using tape, make sure that it is tight and secure before moving on to the next step.
(Sorry I don't have pictures for this step, which I know would help a lot, but I hope my instructions are clear enough to make it work)
Step 4: Playing the Music
You should now have your headphone wire attached to the speaker wires by tape or soldered wires. If you soldered, make sure to cover the soldered wires with tape anyway just to be safe. Now, plug the headphone jack into your iPod or mp3 player and turn it up! it should work perfectly, though it may be rather quiet, as I am still working out the volume tweaking. I am very very new to this, but it worked for me, so it should work for you. You can supposedly add an amplifier in between the headphone jack and speaker to make it louder, but I obviously didn't do it. Anyway, now you can add the speaker to whatever you want, be it a fancy speaker box or a stuffed animal! I hope this helped you, because I've seen many people ask how to do this. Thank you!