FadeIn
Gradually increases volume from 0 to the clip’s original volume over the specified duration.Constructor
Duration of the fade in seconds, applied from the start of the clip. Must be a positive number.
Methods
apply
The AudioClip to apply the fade in effect to
None (modifies the clip in place)
How It Works
The fade in effect:- Calculates the fade period from
clip.offsettoclip.offset + duration - Applies a linear fade factor to each audio sample during the fade period
- Leaves samples after the fade period unmodified
- At the start:
fade_factor = 0(silence) - At the end:
fade_factor = 1(original volume)
Example
The fade is applied relative to the clip’s offset, not absolute timeline position.
FadeOut
Gradually decreases volume from the clip’s original volume to 0 over the specified duration.Constructor
Duration of the fade in seconds, applied at the end of the clip. Must be a positive number.
Methods
apply
The AudioClip to apply the fade out effect to
None (modifies the clip in place)
How It Works
The fade out effect:- Calculates the fade period from
clip.offset + clip.duration - durationtoclip.offset + clip.duration - Applies a linear fade factor to each audio sample during the fade period
- Leaves samples before the fade period unmodified
- At the start:
fade_factor = 1(original volume) - At the end:
fade_factor = 0(silence)
Example
The fade is calculated from the end of the clip backwards by the specified duration.
Combining Fade Effects
You can apply both fade in and fade out to the same clip:Both effects add transforms to the clip’s processing pipeline and work independently. The order of application doesn’t matter since they affect different parts of the clip.