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

gh-104773: PEP 594: Remove the ossaudiodev module #104862

Merged
merged 2 commits into from
May 24, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 24, 2023

  • Remove ossaudiodev extension in configure.ac and regenerate the configure script.
  • Remove ossaudiodev in Modules/Setup and Modules/Setup.stdlib.in.

📚 Documentation preview 📚: https://cpython-previews--104862.org.readthedocs.build/

* Remove ossaudiodev extension in configure.ac and regenerate
  the configure script.
* Remove ossaudiodev in Modules/Setup and Modules/Setup.stdlib.in.
@vstinner
Copy link
Member Author

Using import ossaudiodev|from ossaudiodev regex, I only found a single project in PyPI top 5,000 projects (2023-04-13) using the ossaudiodev: nltk.

See nltk/corpus/reader/timit.py. This code tries ossaudiodev but catches properly ImportError and uses pygame if the ossaudiodev module is missing. If ossaudiodev and pygame are missing, it displays the error message:

you must install pygame or ossaudiodev for audio playback.

In the What's New In Python 3.13 entry, I suggest replacing ossaudiodev with pygame. IMO pygame is a more portable since it supports multiple audio playback backend depending on the platform, whereas ossaudiodev only supports OSS backend (ex: it doesn't support Windows).

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these bits also be deleted?

configure
13492:    OSSAUDIODEV_LIBS="-lossaudio" ;; #(
13494:    OSSAUDIODEV_LIBS=""

configure.ac
3921:  [NetBSD*], [OSSAUDIODEV_LIBS="-lossaudio"],
3922:  [OSSAUDIODEV_LIBS=""]

@@ -157,6 +157,10 @@ Removed
use the :mod:`subprocess` module instead.
(Contributed by Victor Stinner in :gh:`104773`.)

* :pep:`594`: Remove the :mod:`!ossaudiodev` module, deprecated in Python 3.11:
use the `pygame project <https://www.pygame.org/>`_ for audio playback.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to only link to pygame for now. It's unclear to me where the community goes, but so far, "pygame" remains the reference project. I hope that the two communities will merge again. If not, we can update the doc later. The problem is that the Python documentation is not updated frequently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also delete Lib/test/audiotest.au?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My PR #104863 removes it.

@vstinner vstinner merged commit fc07fe4 into python:main May 24, 2023
@vstinner vstinner deleted the remove_ossaudio branch May 24, 2023 13:00
@vstinner
Copy link
Member Author

Can these bits also be deleted? [OSSAUDIODEV_LIBS]

I created PR #104864 to remove it. Well spotted, I missed that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants