PortAudio Tips Quick-Links:

Changing the Volume of Audio

Audio data can easily be made louder or softer by multiplying each sample by a constant. For example, to make audio half as loud (which corresponds to about 6dB of gain reduction), simply multiply each sample by .5. Note that if you change this value abruptly, you might end up with Clicking Noises.