Adding Sounds II
Fading your Sound
Plasma supports FadeIn and FadeOut properties on sound objects. These can make a sound fade gradually. The properties are set in AlcScript on the Sound Emitter object.
fadein: length: start: <starting volume> end: <ending volume> type: <fade type> stop: <stop when finished fading>
The fadeout params are identical, but defined under fadeout rather than fadein.
Length
Length controls how long it takes for the sound to fade in or out. This is a decimal value in number of seconds.
Start
Starting volume defines the percentage of the volume (as a decimal) to use when fading. For fading in, this value should be 0.0. For fading out, this value should be 1.0.
End
The final volume of the sound at the end of the effect, expressed as a decimal percentage. For fading in, this value should be 1.0. For fading out, this value should be 0.0.
Type
Plasma supports three types of fading, these are mathematical equations used internally to produce the fading effect. The three options are
linear #Default fade type logarithmic #Fade using logarithms, best for fading in exponential #Fade using exponents, best for fading out
The fade type is defined as a string of text in AlcScript, using the type names above.
Stop
A boolean value determining whether to stop playing the sound when the effect finishes. This should be set for fadeout effects.