Skip to main content
The afx module provides audio effects that can be applied to AudioClip instances to modify their audio characteristics.

Available Effects

All audio effects inherit from the AudioEffect base class and implement the apply() method to modify audio clips.

FadeIn

Gradually increase volume from 0 to original level

FadeOut

Gradually decrease volume to 0 at the end

Base Class

AudioEffect

Abstract base class for all audio effects.
from movielite.afx.base import AudioEffect

Methods

apply
method
Apply this effect to an audio clip by modifying its properties.
clip
AudioClip
required
The AudioClip to apply the effect to
Returns: None (modifies the clip in place)

Usage

Audio effects are applied to AudioClip instances using their apply() method:
from movielite.audio import AudioClip
from movielite.afx import FadeIn, FadeOut

# Create an audio clip
clip = AudioClip("audio.mp3")

# Apply fade in effect (2 seconds)
fade_in = FadeIn(duration=2.0)
fade_in.apply(clip)

# Apply fade out effect (1.5 seconds)
fade_out = FadeOut(duration=1.5)
fade_out.apply(clip)
Effects work by adding transforms to the audio clip’s processing pipeline. Multiple effects can be applied to the same clip.

Build docs developers (and LLMs) love