Skip to content

Commit

Permalink
Instantiate class directly in from_file instead of using BytesIO and …
Browse files Browse the repository at this point in the history
…_from_safe_wav, which use more memory (#490)
  • Loading branch information
Harrison88 committed Feb 28, 2021
1 parent 6046628 commit 8b9bd24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydub/audio_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,8 @@ def is_format(f):

p_out = bytearray(p_out)
fix_wav_headers(p_out)
obj = cls._from_safe_wav(BytesIO(p_out))
p_out = bytes(p_out)
obj = cls(p_out)

if close_file:
file.close()
Expand Down

0 comments on commit 8b9bd24

Please sign in to comment.