Description:
Python 3.13 has removed the built-in audioop module, which pydub currently depends on in pydub/utils.py. As a result, import audioop fails on Python 3.13.
Proposed solution:
- Wrap the import in a try-except block:
try:
import audioop
except ImportError:
import pyaudioop as audioop # fallback for Python 3.13+
- Add
pyaudioop as an optional dependency in setup.py or pyproject.toml.
- Optionally, include a clear error message if neither
audioop nor pyaudioop is available.
Impact:
This change ensures pydub remains compatible with Python 3.13 and higher, while maintaining backward compatibility with older Python versions.
Reference:
Description:
Python 3.13 has removed the built-in
audioopmodule, whichpydubcurrently depends on inpydub/utils.py. As a result,import audioopfails on Python 3.13.Proposed solution:
pyaudioopas an optional dependency insetup.pyorpyproject.toml.audioopnorpyaudioopis available.Impact:
This change ensures
pydubremains compatible with Python 3.13 and higher, while maintaining backward compatibility with older Python versions.Reference: