The above ought to work. As it is right now, you toggle a PWM from a channel to another, but never both together. To alter the Volume, you'll need a fixed duty on 1 channel, and a variable one on the other.. Not sure if this specific allow to do it.