Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of deprecated module audioop #9477

Open
wookie184 opened this issue Jul 1, 2023 · 4 comments
Open

Use of deprecated module audioop #9477

wookie184 opened this issue Jul 1, 2023 · 4 comments
Labels
bug This is a bug with the library.

Comments

@wookie184
Copy link

wookie184 commented Jul 1, 2023

Summary

discord.py uses the audioop module which will be removed in Python 3.13

Reproduction Steps

On Python 3.11: python -Walways -c "import discord"

Output:

...\Python311\Lib\site-packages\discord\player.py:28: DeprecationWarning: 'audioop' is deprecated and slated for removal in Python 3.13
  import audioop

System Information

- Python v3.11.2-final
- discord.py v2.3.1-final
- aiohttp v3.8.3

Additional Context

The only usage is here:

return audioop.mul(ret, 2, min(self._volume, 2.0))

There doesn't seem to be any standard library alternative, or external library that I can obviously see. It's been a while since it was deprecated so I'm not sure how much chance there is someone will turn it into an external library.

One option could be to try and reimplement it in Python, which seems like it could be doable as it doesn't seem too complicated: https://github.com/python/cpython/blob/036da3bd43aa2593d17d2fb73d4794f9965c577d/Modules/audioop.c#L944, not really sure though.

@wookie184 wookie184 added the unconfirmed bug A bug report that needs triaging label Jul 1, 2023
@Rapptz
Copy link
Owner

Rapptz commented Jul 1, 2023

Yeah I know. When they voted to deprecated I voiced my concerns but I was more or less ignored. I'm unsure what to do going forward, it can't be in Python because this is low latency.

@Rapptz Rapptz added bug This is a bug with the library. and removed unconfirmed bug A bug report that needs triaging labels Jul 9, 2023
@SuperSonicHub1
Copy link

Maintaining audioop ourselves is always an option; it is just one C file.

@AbstractUmbra
Copy link
Contributor

I actually already began work on this. I just need to wait for a less-than-alpha 3.13 release to test the build and CI.

@AbstractUmbra
Copy link
Contributor

I actually already began work on this. I just need to wait for a less-than-alpha 3.13 release to test the build and CI.

I believe this is ready for testing before signing off.
The repository this is located on is here. If you wish to test this then you can install from the git address with pip or use the provided dev container setup.
Pending testing and signoff I will push it to PyPi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug with the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants