I want to know how to set the volume of a wav file during runtime

i have a game and i want it to play a sound according to the distance away from the object. So if i am further from the collision, the sound it played at a lower volume. If i am close, the sound will be played at a higher volume.

I may also need to play these sounds simultaniously at different volumes.

Can anyone give me some advice?