I'm not surprised, your question is too vague.
What kind of "speaker" are you talking about?
I'm old fashioned. To me a speaker looks like this:
http://picclick.co.uk/Kef-bass-driver-S ... 68016.html
There is no way you are going to be driving a speaker form the Pi.
If you mean some modern day active speaker with built in amplifier then it will have cable connection, jack plugs or whatever, so the is no need to solder anything anywhere.
Please try to say exactly what it is you have there and what you want to do with it.
I would advise against soldering anything to a Pi.
Memory in C++ is a leaky abstraction .