moviepy.audio.fx.all.audio_delay¶
-
moviepy.audio.fx.all.
audio_delay
(clip, offset=0.2, n_repeats=8, decay=1)[source]¶ Repeats audio certain number of times at constant intervals multiplying their volume levels using a linear space in the range 1 to
decay
argument value.- Parameters:
- offsetfloat, optional
Gap between repetitions start times, in seconds.
- n_repeatsint, optional
Number of repetitions (without including the clip itself).
- decayfloat, optional
Multiplication factor for the volume level of the last repetition. Each repetition will have a value in the linear function between 1 and this value, increasing or decreasing constantly. Keep in mind that the last repetition will be muted if this is 0, and if is greater than 1, the volume will increase for each repetition.
Examples
>>> from moviepy import * >>> videoclip = AudioFileClip('myaudio.wav').fx( ... audio_delay, offset=.2, n_repeats=10, decayment=.2 ... )
>>> # stereo A note >>> make_frame = lambda t: np.array( ... [np.sin(440 * 2 * np.pi * t), np.sin(880 * 2 * np.pi * t)] ... ).T ... clip = AudioClip(make_frame=make_frame, duration=0.1, fps=44100) ... clip = audio_delay(clip, offset=.2, n_repeats=11, decay=0)