2
我想为自己编写我自己的自定义音频过滤器。如何使用影片制作自定义音频过滤器?
我在看audio_fadein作为一个例子,但是我有麻烦理解(t)的输入变量的预期的类型。
任何人都可以解释预期的T类型是什么?或者在电影代码中,我可以看看哪些库来自或被使用?感谢您的帮助,非常感谢。
@audio_video_fx
def audio_fadein(clip, duration):
"""Return an audio (or video) clip that is first mute, then the
sound arrives progressively over ``duration`` seconds."""
def fading(gf,t):
gft = gf(t)
if np.isscalar(t):
factor = min(1.0 * t/duration, 1)
factor = np.array([factor,factor])
else:
factor = np.minimum(1.0 * t/duration, 1)
factor = np.vstack([factor,factor]).T
return factor * gft
return clip.fl(fading, keep_duration = True)