The black spots when using the rear camera is caused by dust going inside the lens. You could try cleaning it out with something like a air compressor but you will be lucky if you are able to clean inside the lens.
You will need to replace the rear camera along with the rear camera glass at the same time to fix that issue.
S6 edge won't work on S6 as far as I know because they are slightly different in size to fit in.
When buying a rear camera make sure it is compatible with your model first.
You can either buy the mid frame which comes with the speaker or just the speaker itself meaning you will need to transfer the new speaker into the midframe.
Personally I would replace the whole midframe to be safe, also make sure that is for your model number of the phone as there are different variants for that too.
Here's iFixit guides if needed:
Samsung Galaxy S6 Midframe Assembly Replacement
Samsung Galaxy S6 Rear Facing Camera Replacement