def apply(self, clip: Clip) -> Clip:
        """Apply the effect to the clip."""
        if self.duration is not None:
            self.n_loops = int(self.duration / clip.duration) + 1
            return concatenate_audioclips(self.n_loops * [clip]).with_duration(
                self.duration
            )

        return concatenate_audioclips(self.n_loops * [clip])
Apply the effect to the clip.
moviepy/audio/fx/AudioLoop.py