-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #582 from gpantelis/patch-7
PEP 8 compatible
- Loading branch information
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
from moviepy.decorators import audio_video_fx | ||
|
||
|
||
@audio_video_fx | ||
def volumex(clip, factor): | ||
""" Returns a clip with audio volume multiplied by the | ||
value `factor`. Can be applied to both audio and video clips. | ||
This effect is loaded as a clip method when you use moviepy.editor, | ||
so you can just write ``clip.volumex(2)`` | ||
Examples | ||
--------- | ||
>>> newclip = volumex(clip, 2.0) # doubles audio volume | ||
>>> newclip = clip.fx( volumex, 0.5) # half audio, use with fx | ||
>>> newclip = clip.volumex(2) # only if you used "moviepy.editor" | ||
""" | ||
""" | ||
return clip.fl(lambda gf, t: factor * gf(t), | ||
keep_duration = True) | ||
keep_duration=True) | ||
|