Convert PWM to Analog using a DAC chip in order to emulate a Potentiometer for audio
To control audio signal gain with a PWM channel, simply connect the audio input and ground to the inputs of an analog SPDT switch, and connect the PWM signal to the switch's control input. 

The output is fed to a low pass filter with a corner frequency somewhere between the top of the audio band of interest (say, 20kHz), and the PWM switching frequency (say, 100kHz). For cleanest waveform, a corner frequency of just over 20kHz - or a high order brick wall filter as used in early CD players.