jiaaro/pydub

audioop deprecation - Python 3.12

elderlabs opened this issue · 7 comments

Audioop is deprecated as of Python 3.11, removal in 3.13 (source). What's the plan for its replacement once it's no longer available? I've seen snippets floating around of audio manipulation with numpy arrays, but from my reading, it's also possible to overflow in instances of volume scaling/manipulation. It doesn't seem like there's an ideal solution to this or a replacement for audioop once it's gone. Perhaps someone will port it to a package...

Thanks.

Tenzer commented

pydub includes a pure-Python fallback for audioop. It is imported here:

pydub/pydub/utils.py

Lines 14 to 17 in 996cec4

try:
import audioop
except ImportError:
import pyaudioop as audioop

The implementation is here: https://github.com/jiaaro/pydub/blob/master/pydub/pyaudioop.py.