pydub icon indicating copy to clipboard operation
pydub copied to clipboard

AudioSegment.from_mp3 high latency for short audio clips (70-150ms)

Open mukundt opened this issue 1 year ago • 0 comments

Steps to reproduce

I'm calling AudioSegment.from_mp3 with a file-like object (io.BytesIO()) containing ~5 seconds of audio. The latency of this single line is between 70-150ms on my M1 MacBook.

audio_segment: AudioSegment = AudioSegment.from_mp3(
                    io.BytesIO(audio_data)
                )

Is this expected? Is there any way to reduce latency? My goal is to convert a MP3 bytestring into a PCM-encoded WAV bytestring in as low latency as possible.

Thanks!

mukundt avatar Jul 14 '23 00:07 mukundt