There's an answer to that question here on SO (changing the master volume from C++, which also includes SetMute, etc.)
Have you considered showing the Volume controls and letting the user?
If so, I can post some code for that. (You basically just shell out to the volume control applet.