Skip to content

Commit

Permalink
Improved the performance of AudioSegment pydub to be 10x faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
majedbawarshi committed Sep 19, 2022
1 parent 0c26b10 commit 20ce8be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydub/audio_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import array
import os
import subprocess
from tempfile import TemporaryFile, NamedTemporaryFile
from tempfile import NamedTemporaryFile
import wave
import sys
import struct
Expand Down Expand Up @@ -1264,7 +1264,7 @@ def append(self, seg, crossfade=100):
xf = seg1[-crossfade:].fade(to_gain=-120, start=0, end=float('inf'))
xf *= seg2[:crossfade].fade(from_gain=-120, start=0, end=float('inf'))

output = TemporaryFile()
output = BytesIO()

output.write(seg1[:-crossfade]._data)
output.write(xf._data)
Expand Down

0 comments on commit 20ce8be

Please sign in to comment.