Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 815 Bytes

File metadata and controls

36 lines (24 loc) · 815 Bytes

set Volume

Set the volume for the sound synthesizer.

The synthesizer volume controls the level of the sound playing on current sound output of the board (speaker or pin).

music.setVolume(128)

#simnote

~hint

Simulator: ||music:set volume|| works on the @boardname@. It might not work in the simulator on every browser.

~

Parameters

  • volume: the volume of of the sounds played to the sound output. The volume number can be between 0 for silent and 255 for the loudest sound.

Example #example

Set the synthesizer volume to something quieter.

music.setVolume(50)
music.playSound(music.sounds(Sounds.BaDing))

See also #seealso

play sound, sounds

music