Provide a way to set a channel's volume without creating popping artifacts

The issue happens regardless of format or method of playing the audio. The code I provided demonstrates the issue with just a basic sine wave.