Last updated 2 years ago
How do you change the volume of music in your game so some things are louder than others?
Hi Heath,
Take a look at the reference page for the playSound() function. This function takes three parameters, and the third one is the volume of the sound specified with a value between 0 and 1 with 1 being the loudest.
So you could use the following:
setCanvasSize(500, 400)
blip = loadSound("/samples/sounds/blip.wav")
text("Hit W to make a 'blip' sound!", 0, 0)
while True:
if isKeyPressed(KEY_W):
playSound(blip, False, 0.25)Become a free member to post a comment about this question.