Lingo Dictionary > S > sound fadeOut

 

sound fadeOut

Syntax

sound(whichChannel).fadeOut()
sound(whichChannel).fadeOut(milliseconds)
sound fadeOut whichChannel
sound fadeOut whichChannel, ticks

Description

Command; fades out a sound in the specified sound channel over a period of frames or ticks.

When ticks is specified, the fade out occurs evenly over that period of time.

When ticks is not specified, the default number of ticks is calculated as 15 * (60 / (tempo setting)) based on the tempo setting for the first frame of the fade out.

The fade out continues at a predetermined rate until the number of ticks has elapsed, or until the sound in the specified channel changes.

If the sound is stopped before it reaches the minimum volume, it remains at the level it was stopped at, causing subsequent playback to be at this volume. Be sure to allow the sound to finish fading completely.

Note: You may want to use the fadeTo() sound property to create a custom sound fade to allow more control over the actual volume of the channel.

This command has been replaced by the fadeOut() command, which requires dot syntax. Consider using that command instead. When using fadeOut() with dot syntax, the fade out occurs over the specified number of milliseconds.

The default length of the fade out is one second, regardless of whether ticks or milliseconds are being used.

Example

This statement fades out the sound in channel 1 over 3.5 seconds:

sound(1).fadeOut(3500)

See also

fadeIn(), fadeOut(), fadeTo(), puppetSound, sound fadeIn, volume (sprite property)