Skip to content

Commit

Permalink
Remove audio_loop afx (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
tburrows13 committed Jan 16, 2021
1 parent b550d00 commit 727cbca
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `moviepy.video.fx.all` and `moviepy.audio.fx.all`. Use the fx method directly from the clip instance or import the fx function from `moviepy.video.fx` and `moviepy.audio.fx`. [\#1105](https://github.com/Zulko/moviepy/pull/1105)

### Removed <!-- for now removed features -->
- `audio.fx.audio_loop` removed. Use `video.fx.loop` instead for all types of clip [\#1451](https://github.com/Zulko/moviepy/pull/1451)

### Fixed <!-- for any bug fixes -->
- Fixed BitmapClip with fps != 1 not returning the correct frames or crashing [\#1333](https://github.com/Zulko/moviepy/pull/1333)
Expand Down
1 change: 0 additions & 1 deletion docs/ref/audiofx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ the module ``audio.fx`` is loaded as ``afx`` and you can use ``afx.multiply_volu

audio_fadein
audio_fadeout
audio_loop
audio_normalize
multiply_stereo_volume
multiply_volume
6 changes: 0 additions & 6 deletions docs/ref/audiofx/moviepy.audio.fx.all.audio_loop.rst

This file was deleted.

2 changes: 1 addition & 1 deletion moviepy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# Transforms the effects into Clip methods so that
# they can be called with clip.resize(width=500) instead of
# clip.fx(vfx.resize, width=500)
audio_fxs = inspect.getmembers(afx, inspect.isfunction)
audio_fxs = inspect.getmembers(afx, inspect.isfunction) + [("loop", vfx.loop)]
video_fxs = (
inspect.getmembers(vfx, inspect.isfunction)
+ inspect.getmembers(transfx, inspect.isfunction)
Expand Down
1 change: 0 additions & 1 deletion moviepy/audio/fx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from .audio_fadein import audio_fadein
from .audio_fadeout import audio_fadeout
from .audio_loop import audio_loop
from .audio_normalize import audio_normalize
from .multiply_stereo_volume import multiply_stereo_volume
from .multiply_volume import multiply_volume
2 changes: 1 addition & 1 deletion moviepy/audio/fx/all/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
moviepy.audio.fx.all is deprecated.
Use the fx method directly from the clip instance (e.g. ``clip.audio_loop(...)``)
Use the fx method directly from the clip instance (e.g. ``clip.audio_normalize(...)``)
or import the function from moviepy.audio.fx instead.
"""
import warnings
Expand Down
26 changes: 0 additions & 26 deletions moviepy/audio/fx/audio_loop.py

This file was deleted.

10 changes: 9 additions & 1 deletion tests/test_fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ def test_loop():
clip3 = loop(clip, n=3) # loop 3 times
clip3.write_videofile(os.path.join(TMP_DIR, "loop3.webm"))

clip = AudioClip(
lambda t: np.sin(440 * 2 * np.pi * t) * (t % 1) + 0.5, duration=2.5, fps=44100
)
clip1 = clip.loop(2)
# TODO fix AudioClip.__eq__()
# assert concatenate_audioclips([clip, clip]) == clip1

close_all_clips(objects=locals())


Expand Down Expand Up @@ -572,4 +579,5 @@ def test_multiply_stereo_volume():


if __name__ == "__main__":
pytest.main()
# pytest.main()
test_loop()

0 comments on commit 727cbca

Please sign in to comment.