Scaling PWM amplitude by switching an analog DC voltage?
Yes, you can adjust the top of the PWM signal to effectively get volume adjustment.  However, there are two problems with this:

If the rising and falling edges are not symmetric then the signal will have some distortion.  A CMOS digital output, like the PWM signal out of the micro, will be pretty symmetric, and any assymetry will be limited to a very narrow time window, which again ensures that the overall assymetry is small relative to the signal amplitude.  With circuitry that has to allow for a variable top level, you probably won't have the same level of symmetry, and probably slower edges too.

The volume setting will introduce a variable DC level on the AC signal.  This will generally be slow enough so that most of it can be filtered out downstream, but it can cause problems if not thought about carefully.



I think a better scheme is to incorporate the volume control into the micro and produce the PWM already scaled to the desired volume.  You can hook up a pot straight to the A/D input of the micro to give it volume input, and the rest is simple firmware.  This has another advantage in that you can implement log volume if you want to.  Log pots for the analog solution are getting harder to find nowadays, or more expensive when you do find them.  Again, a digital processor can do this easily.