You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Plays the note A in mono (a sine wave of frequency 440 Hz)importnumpyasnpframe_function=lambdat: np.sin(440*2*np.pi*t)
clip=AudioClip(frame_function, duration=5, fps=44100)
clip.preview()
# Plays the note A in stereo (two sine waves of frequencies 440 and 880 Hz)frame_function=lambdat: np.array([
np.sin(440*2*np.pi*t),
np.sin(880*2*np.pi*t)
]).T.copy(order="C")
clip=AudioClip(frame_function, duration=3, fps=44100)
clip.preview()
Specifications
Python Version: 3.12.7
MoviePy Version: 2.1.1
Platform Name: Linux
Platform Version: 6.6.63-1-MANJARO
Additional Notes
I also tried the audiopreview() method on the AudioClip and I get this traceback
Traceback (most recent call last):
File "main.py", line 82, in <module>
test_audio()
File "main.py", line 68, in test_audio
clip.audiopreview()
File "<decorator-gen-47>", line 2, in audiopreview
File "/usr/lib/python3.12/site-packages/moviepy/decorators.py", line 53, in requires_duration
return func(clip, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/moviepy/audio/AudioClip.py", line 301, in audiopreview
ffplay_audiopreview(
File "<decorator-gen-11>", line 2, in ffplay_audiopreview
File "/usr/lib/python3.12/site-packages/moviepy/decorators.py", line 53, in requires_duration
return func(clip, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/moviepy/audio/io/ffplay_audiopreviewer.py", line 154, in ffplay_audiopreview
previewer.write_frames(chunk)
File "/usr/lib/python3.12/site-packages/moviepy/audio/io/ffplay_audiopreviewer.py", line 68, in write_frames
self.logfile.seek(0)
^^^^^^^^^^^^
AttributeError: 'FFPLAY_AudioPreviewer' object has no attribute 'logfile'
The text was updated successfully, but these errors were encountered:
Just tried and audiopreview seems to work with latest version (2.1.2), can you confirm (also I just lost hearing in my left ear and my dog is howling in the corner of the room...).
Expected Behavior
I expect to hear the audio on preview
Actual Behavior
I get this error
AttributeError: 'AudioClip' object has no attribute 'preview'
Steps to Reproduce the Problem
I use the code straight from the documentation moviepy.audio.AudioClip.AudioClip
Specifications
Additional Notes
I also tried the audiopreview() method on the AudioClip and I get this traceback
The text was updated successfully, but these errors were encountered: