Sounds > Sounds


Read our Sounds article for an explanation of these blocks.


Playback

Play / Loop Sound

play sound

Plays (or loops) the chosen sound on the next available channel.

playSound([SOUND]);
loopSound([SOUND]);

Stop all Sounds

stop all sounds

Immediately stops playback of all sounds.

stopAllSounds();

Volume

Set Volume

set volume to number %

Sets the global sound volume level. Individual channels maintain their own volume level, which is multiplied against the global volume level. Specify a value between [0-100] inclusive.

setVolumeForAllSounds([NUMBER]/100);

Fade Volume In / Out

fade in over number secs

Fades the global sound volume level in (to 100%) or out (to 0%) over time, given in seconds.

fadeInForAllSounds([NUMBER]);
fadeOutForAllSounds([NUMBER]);

Fade Volume to Percent

fade to number % over number secs

Fades global volume to the given percent.

fadeForAllSounds([NUMBER], [NUMBER]);

Channels

Play / Loop Sound on Channel

play sound on channel int

Plays (or loops) a sound on the specified channel. If one was previously playing on the channel, it stops and gets replaced.

playSoundOnChannel([SOUND], [INT]);
loopSoundOnChannel([SOUND], [INT]);

Stop / Pause / Resume Sound on Channel

stop sound on channel int

Controls playback of a sound on the specified channel (if one is playing). Stopping a sound and resuming will force it start from the beginning.

stopSoundOnChannel([INT]);
pauseSoundOnChannel([INT]);
resumeSoundOnChannel([INT]);

Set Volume on Channel

set volume to number % for channel int

Sets the volume level for the specified channel, which is multiplied against the global volume level. Specify a value between [0-100] inclusive.

setVolumeForChannel([NUMBER]/100, [INT]);

Fade Volume In / Out on Channel

fade in sound on channel int over number secs

Fades the sound volume level for the specified channel in (to 100%) or out (to 0%) over time. Duration is given in seconds.

fadeInSoundOnChannel([INT], [NUMBER]);
fadeOutSoundOnChannel([INT], [NUMBER]);

Fade Volume to Percent on Channel

fade sound to number % on channel int over number secs

Fades channel volume to the given percent.

fadeSoundOnChannel([INT], [NUMBER], [NUMBER]);

Set Panning on Channel

set panning to number % for channel int

Sets the panning of a channel (negative 100% is far left, positive 100% is far right).

setPanningForChannel([NUMBER]/100, [INT]);

Set Position on Channel

set position for channel int to int

Set position for sound on a specific channel in milliseconds.

setPositionForChannel([INT], [INT]);

Sound Position on Channel

get position for channel int

Returns the current playback position of the sound on the specified channel in milliseconds.

getPositionForChannel([INT])

Length of Track on Channel

get length for channel int

Returns the length of the sound on the specified channel in milliseconds.

getSoundLengthForChannel([INT])

Length of Sound

get length for sound

Returns the length of the specified sound in milliseconds.

getSoundLength([SOUND])

Get Sound with Name

sound with name text

Returns a sound, given its name.

getSoundByName([TEXT])