pydub
pydub copied to clipboard
AudioSegment.from_mp3 high latency for short audio clips (70-150ms)
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!