Skip to content

Commit

Permalink
deprecation warnings #1338
Browse files Browse the repository at this point in the history
  • Loading branch information
somstrom committed Oct 25, 2020
1 parent 344aa04 commit 85b721f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions moviepy/audio/AudioClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,21 @@ def iter_chunks(

positions = np.linspace(0, total_size, nchunks + 1, endpoint=True, dtype=int)

sound_arrays = []
for i in logger.iter_bar(chunk=list(range(nchunks))):
size = positions[i + 1] - positions[i]
assert size <= chunksize
timings = (1.0 / fps) * np.arange(positions[i], positions[i + 1])
yield self.to_soundarray(
timings, nbytes=nbytes, quantize=quantize, fps=fps, buffersize=chunksize
sound_arrays.append(
self.to_soundarray(
timings,
nbytes=nbytes,
quantize=quantize,
fps=fps,
buffersize=chunksize,
)
)
return sound_arrays

@requires_duration
def to_soundarray(
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/io/gif_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def write_gif(
if with_mask:
mask = 255 * clip.mask.get_frame(t)
frame = np.dstack([frame, mask]).astype("uint8")
proc1.stdin.write(frame.tostring())
proc1.stdin.write(frame.tobytes())

except IOError as err:

Expand Down

0 comments on commit 85b721f

Please sign in to comment.