Reference setVolume()

setVolume()

Multiply the output volume (amplitude) of a sound file between 0.0 (silence) and 1.0 (full volume). 1.0 is the maximum amplitude of a digital sound, so multiplying by greater than 1.0 may cause digital distortion. To fade, provide a rampTime parameter. For more complex fades, see the Envelope class.

Alternately, you can pass in a signal source such as an oscillator to modulate the amplitude with an audio signal.

Syntax

setVolume(volume, [rampTime], [timeFromNow])

Parameters

volume
Number|Object:

Volume (amplitude) between 0.0 and 1.0 or modulating signal/oscillator

rampTime
Number:

Fade for t seconds

timeFromNow
Number:

Schedule this event to happen at t seconds in the future

This page is generated from the comments in lib/addons/p5.sound.js . Please feel free to edit it and submit a pull request!

Related References